Пример #1
0
    def test_user(self):
        with self.instance.test_request_context() as request:
            u = UserFactory(login='******', email='*****@*****.**')

            self.assertTrue(u.is_authenticated())
            self.assertTrue(u.is_active())
            self.assertFalse(u.is_anonymous())
Пример #2
0
    def test_user_check_password(self):
        with self.instance.test_request_context() as request:
            u = UserFactory(login='******', email='*****@*****.**')

            self.assertTrue(u.is_authenticated())
            self.assertTrue(u.is_active())
            self.assertFalse(u.is_anonymous())

            password = '******'
            u.set_password(password)

            self.assertTrue(u.check_password(password))