Commit aebe4fba authored by Oliver Falk's avatar Oliver Falk
Browse files

Merge branch 'devel' into 'master'

Work on tests - esp. for Django 3 compatibility

See merge request !159
parents d4e09100 9968c68b
Loading
Loading
Loading
Loading
Loading
+26 −5
Original line number Diff line number Diff line
@@ -1228,7 +1228,7 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods
        response = self.client.get(url, follow=True)
        self.assertRedirects(
            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?')
        # 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,
        )

        self.assertContains(
            response,
            'The two password fields didn't match.',
            'The two password fields didn',
            1,
            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):
@@ -1456,12 +1455,34 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods

        self.assertContains(
            response,
            'The two password fields didn't match.',
            'The two password fields didn',
            1,
            200,
            '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):
        '''
        Test if profile view correctly lists first -/last name