Пример #1
0
 def test_user_password_request_failure_wrong_key(self):
     request = testing.DummyRequest(
         json_body={'emai': '*****@*****.**'},
         mailer=DummyMailer)
     response = user_password_request(request)
     self.assertIsNotNone(response)
     self.assertTrue(400 == response.status_code)
Пример #2
0
 def test_user_password_request_failure_wrong_email(self):
     request = construct_dummy_request(
         json_body={'email': '*****@*****.**'})
     response = user_password_request(request)
     self.assertIsNotNone(response)
     self.assertFalse(response['success'])
     self.assertNotEqual(len(response['message']), 0)
Пример #3
0
 def test_user_password_request_failure_wrong_email(self):
     request = testing.DummyRequest(
         json_body={'email': '*****@*****.**'},
         mailer=DummyMailer)
     response = user_password_request(request)
     self.assertIsNotNone(response)
     self.assertFalse(response['success'])
     self.assertTrue(len(response['message']) != 0)
Пример #4
0
 def test_user_password_request(self):
     db_user = DBDiscussionSession.query(User).filter_by(nickname='Tobias').first()
     request = construct_dummy_request(json_body={'email': '*****@*****.**'})
     response = user_password_request(request)
     self.assertIsNotNone(response)
     self.assertNotEqual(db_user.password, get_hashed_password('tobias'))
     db_user.password = get_hashed_password('tobias')
     transaction.commit()
Пример #5
0
 def test_user_password_request(self):
     db_user = DBDiscussionSession.query(User).filter_by(
         nickname='Tobias').first()
     request = testing.DummyRequest(
         json_body={'email': '*****@*****.**'},
         mailer=DummyMailer)
     response = user_password_request(request)
     self.assertIsNotNone(response)
     self.assertTrue(db_user.password != get_hashed_password('tobias'))
     db_user.password = get_hashed_password('tobias')
     transaction.commit()
Пример #6
0
 def test_user_password_request_failure_wrong_key(self):
     request = construct_dummy_request(
         json_body={'emai': '*****@*****.**'})
     response = user_password_request(request)
     self.assertIsNotNone(response)
     self.assertEqual(response.status_code, 400)