Skip to content

Commit

Permalink
tests/organisations//users: use translatable strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rineee authored and fuzzylogic2000 committed Sep 28, 2020
1 parent 16e8c96 commit 0593cac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/organisations/test_admin.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions tests/users/test_user_admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from django.urls import reverse
from django.utils.translation import ngettext

from meinberlin.apps.users.models import User

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0593cac

Please sign in to comment.