From 18dd9ba4812fb85297a6fab19ea2404cd60b8ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Freitag?= Date: Fri, 1 Sep 2017 18:43:41 -0700 Subject: [PATCH] Fixed test in auth_tests modifying data from setUpTestData(). --- tests/auth_tests/test_signals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auth_tests/test_signals.py b/tests/auth_tests/test_signals.py index 93a8689463..ab2b792de9 100644 --- a/tests/auth_tests/test_signals.py +++ b/tests/auth_tests/test_signals.py @@ -79,7 +79,7 @@ class SignalTestCase(TestCase): user.username = "This username shouldn't get saved" request = RequestFactory().get('/login') signals.user_logged_in.send(sender=user.__class__, request=request, user=user) - user.refresh_from_db() + user = User.objects.get(pk=user.pk) self.assertEqual(user.username, 'staff') self.assertNotEqual(user.last_login, old_last_login)