mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-13 11:46:22 +00:00
Add test for common password and adapt expected text for wrong pw, since Django 3 seems to return Unicode. Also fix exptected URL in some test
This commit is contained in:
@@ -1228,7 +1228,7 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods
|
|||||||
response = self.client.get(url, follow=True)
|
response = self.client.get(url, follow=True)
|
||||||
self.assertRedirects(
|
self.assertRedirects(
|
||||||
response=response,
|
response=response,
|
||||||
expected_url='/gravatarproxy/1b1d0b654430c012e47e350db07c83c5?s=80&default=mm',
|
expected_url='/static/img/mm/80.png',
|
||||||
msg_prefix='Why does this not redirect to the gravatarproxy and defaulting to mm?')
|
msg_prefix='Why does this not redirect to the gravatarproxy and defaulting to mm?')
|
||||||
# Eventually one should check if the data is the same
|
# Eventually one should check if the data is the same
|
||||||
|
|
||||||
@@ -1431,13 +1431,12 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods
|
|||||||
},
|
},
|
||||||
follow=True,
|
follow=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertContains(
|
self.assertContains(
|
||||||
response,
|
response,
|
||||||
'The two password fields didn't match.',
|
'The two password fields didn',
|
||||||
1,
|
1,
|
||||||
200,
|
200,
|
||||||
'Old password as entered incorrectly, site should raise an error'
|
'Old password was entered incorrectly, site should raise an error'
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_password_change_view_post_wrong_new_password2(self):
|
def test_password_change_view_post_wrong_new_password2(self):
|
||||||
@@ -1456,12 +1455,34 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods
|
|||||||
|
|
||||||
self.assertContains(
|
self.assertContains(
|
||||||
response,
|
response,
|
||||||
'The two password fields didn't match.',
|
'The two password fields didn',
|
||||||
1,
|
1,
|
||||||
200,
|
200,
|
||||||
'Old password as entered incorrectly, site should raise an error'
|
'Old password as entered incorrectly, site should raise an error'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_password_change_view_post_common_password(self):
|
||||||
|
'''
|
||||||
|
Test password change view post
|
||||||
|
'''
|
||||||
|
self.login()
|
||||||
|
response = self.client.post(
|
||||||
|
reverse('password_change'), {
|
||||||
|
'old_password': self.password,
|
||||||
|
'new_password1': 'Hallo',
|
||||||
|
'new_password2': 'Hallo',
|
||||||
|
},
|
||||||
|
follow=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertContains(
|
||||||
|
response,
|
||||||
|
'This password is too common.',
|
||||||
|
1,
|
||||||
|
200,
|
||||||
|
'Common password, site should raise an error'
|
||||||
|
)
|
||||||
|
|
||||||
def test_profile_must_list_first_and_lastname(self):
|
def test_profile_must_list_first_and_lastname(self):
|
||||||
'''
|
'''
|
||||||
Test if profile view correctly lists first -/last name
|
Test if profile view correctly lists first -/last name
|
||||||
|
|||||||
Reference in New Issue
Block a user