diff --git a/tests/test_progit_flask_ui_admin.py b/tests/test_progit_flask_ui_admin.py
index 54013bf..393b375 100644
--- a/tests/test_progit_flask_ui_admin.py
+++ b/tests/test_progit_flask_ui_admin.py
@@ -62,8 +62,9 @@ class ProgitFlaskAdmintests(tests.Modeltests):
self.assertTrue(
'
Access restricted' in output.data)
- user.username = 'pingou'
- user.groups.append(progit.APP.config['ADMIN_GROUP'])
+ user = tests.FakeUser(
+ username='pingou',
+ groups=progit.APP.config['ADMIN_GROUP'])
with tests.user_set(progit.APP, user):
output = self.app.get('/admin', follow_redirects=True)
self.assertEqual(output.status_code, 200)