Verified Commit 6dafa1ff authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Add unit test for lookup_user_from_address

parent fc05e7e0
...@@ -62,3 +62,17 @@ class TestUser(TestCase): ...@@ -62,3 +62,17 @@ class TestUser(TestCase):
'password') 'password')
self.assertTrue(user.is_staff) self.assertTrue(user.is_staff)
self.assertTrue(user.is_superuser) self.assertTrue(user.is_superuser)
def test_lookup_user(self):
for unknown_email in (None, '', 'unknown@example.org',):
self.assertEquals(
None,
User.objects.lookup_user_from_address(unknown_email)
)
user = User.objects.create_user('email@example.com', 'test user',
'password')
self.assertEquals(
User.objects.lookup_user_from_address('User <email@example.com>'),
user
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment