From 0593cacd9106f571de508677a58824e0399dc569 Mon Sep 17 00:00:00 2001 From: Rineee Date: Fri, 25 Sep 2020 15:55:58 +0200 Subject: [PATCH] tests/organisations//users: use translatable strings --- tests/organisations/test_admin.py | 5 +++-- tests/users/test_user_admin.py | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/organisations/test_admin.py b/tests/organisations/test_admin.py index e8067a6d07..3af9c7702b 100644 --- a/tests/organisations/test_admin.py +++ b/tests/organisations/test_admin.py @@ -1,5 +1,6 @@ import pytest from django.urls import reverse +from django.utils.translation import ngettext from adhocracy4.projects.models import Project from meinberlin.apps.organisations.models import Organisation @@ -54,8 +55,8 @@ def test_organisation_admin_form(client, user_factory, group_factory): } response = client.post(url, data) - msg = '{} is member of several groups ' \ - 'in that organisation.'.format(user.email) + msg = ngettext('%(duplicates)s is member of several groups in ' + 'that organisation.', '', 1) % {'duplicates': user.email} assert msg in response.context['errors'][0] assert response.status_code == 200 diff --git a/tests/users/test_user_admin.py b/tests/users/test_user_admin.py index 448101069d..4e0bb309c0 100644 --- a/tests/users/test_user_admin.py +++ b/tests/users/test_user_admin.py @@ -1,5 +1,6 @@ import pytest from django.urls import reverse +from django.utils.translation import ngettext from meinberlin.apps.users.models import User @@ -44,8 +45,9 @@ def test_user_admin_form(client, } response = client.post(url, data) - msg = 'User is member in more than one group in ' \ - 'this organisation: {}.'.format(organisation.name) + msg = ngettext('User is member in more than one group in this ' + 'organisation: %(duplicates)s.', '', + 1) % {'duplicates': organisation.name} assert msg in response.context['errors'][0] assert response.status_code == 200