Example #1
0
 def test_update_email(self) -> None:
     """Update email address of user profile."""
     old_email, new_email = '*****@*****.**', '*****@*****.**'
     user = User.from_alias('delta_one')
     assert user.email == old_email
     User.update(user.id, email=new_email)
     assert User.from_alias('delta_one').email == User.from_email(
         new_email).email
     User.update(user.id, email=old_email)
     assert User.from_alias('delta_one').email == User.from_email(
         old_email).email
Example #2
0
 def test_from_email_missing(self) -> None:
     """Test exception on missing user `email`."""
     with pytest.raises(NotFound):
         User.from_email('*****@*****.**')
Example #3
0
 def test_from_email(self, testdata: TestData) -> None:
     """Test loading user profile from `email`."""
     for user in testdata['user']:
         assert User.from_email(user['email']).email == user['email']