Beispiel #1
0
 def test_get_user_by_email_returns_none_when_no_matching_user(self):
     repo = UserRepo(TEST_SESSION_FACTORY)
     u = User(username="******", email="good@somewhere")
     repo.add_user(u)
     self.assertIsNone(repo.get_by_email("bad@nowhere"))
Beispiel #2
0
 def test_get_user_by_email_returns_correct_user_when_user_exists(self):  # pylint: disable=line-too-long
     repo = UserRepo(TEST_SESSION_FACTORY)
     u = User(username="******", email="good@somewhere")
     repo.add_user(u)
     actual_u = repo.get_by_email("good@somewhere")
     self.assertEqual(u, actual_u)
Beispiel #3
0
 def test_get_user_by_email_returns_none_when_no_users(self):
     repo = UserRepo(TEST_SESSION_FACTORY)
     self.assertIsNone(repo.get_by_email("bad@nowhere"))