Merge branch 'master' into Kerl/drop_py2_compat

This commit is contained in:
Martin Pépin 2018-01-10 20:12:59 +01:00
commit 5a5b60ec4d
48 changed files with 483 additions and 290 deletions

View file

@ -452,7 +452,7 @@ class AccountGroupUpdateViewTests(ViewTestCaseMixin, TestCase):
'kfet.manage_perms',
)
self.group = Group.objects.create(name='K-Fêt - Group')
self.group.permissions = self.perms.values()
self.group.permissions.set(self.perms.values())
def test_get_ok(self):
r = self.client.get(self.url)

View file

@ -57,7 +57,7 @@ class TestCaseMixin:
'path': request.get_full_path(),
'username': (
"'{}'".format(request.user)
if request.user.is_authenticated()
if request.user.is_authenticated
else 'anonymous'
),
'code': response.status_code,
@ -96,7 +96,7 @@ class TestCaseMixin:
'path': request.get_full_path(),
'username': (
"'%s'" % request.user
if request.user.is_authenticated()
if request.user.is_authenticated
else 'anonymous'
),
'form_ctx': form_ctx,

View file

@ -184,5 +184,5 @@ def user_add_perms(user, perms_labels):
# If permissions have already been fetched for this user, we need to reload
# it to avoid using of the previous permissions cache.
# https://docs.djangoproject.com/en/1.11/topics/auth/default/#permission-caching
# https://docs.djangoproject.com/en/dev/topics/auth/default/#permission-caching
return User.objects.get(pk=user.pk)