Browse Source

Fix build

rafalp 6 years ago
parent
commit
1fcf38f46f
1 changed files with 10 additions and 5 deletions
  1. 10 5
      misago/users/tests/test_user_create_api.py

+ 10 - 5
misago/users/tests/test_user_create_api.py

@@ -516,20 +516,25 @@ class UserCreateTests(UserTestCase):
     @override_dynamic_settings(account_activation="none")
     @override_dynamic_settings(account_activation="none")
     def test_registration_creates_user_with_whitespace_password(self):
     def test_registration_creates_user_with_whitespace_password(self):
         """api creates user with spaces around password"""
         """api creates user with spaces around password"""
+        password = " %s " % self.USER_PASSWORD
         response = self.client.post(
         response = self.client.post(
             self.api_link,
             self.api_link,
-            data={"username": "Bob", "email": "bob@bob.com", "password": " password "},
+            data={
+                "username": "User",
+                "email": "user@example.com",
+                "password": password,
+            },
         )
         )
         self.assertEqual(response.status_code, 200)
         self.assertEqual(response.status_code, 200)
         self.assertEqual(
         self.assertEqual(
             response.json(),
             response.json(),
-            {"activation": "active", "username": "Bob", "email": "bob@bob.com"},
+            {"activation": "active", "username": "User", "email": "user@example.com"},
         )
         )
 
 
-        User.objects.get_by_username("Bob")
+        User.objects.get_by_username("User")
 
 
-        test_user = User.objects.get_by_email("bob@bob.com")
+        test_user = User.objects.get_by_email("user@example.com")
         self.assertEqual(Online.objects.filter(user=test_user).count(), 1)
         self.assertEqual(Online.objects.filter(user=test_user).count(), 1)
-        self.assertTrue(test_user.check_password(" password "))
+        self.assertTrue(test_user.check_password(password))
 
 
         self.assertIn("Welcome", mail.outbox[0].subject)
         self.assertIn("Welcome", mail.outbox[0].subject)