def test_two_users_exist(self): UserProfile.objects.create( fxa_id='9999', email='*****@*****.**', username='******') UserProfile.objects.create( fxa_id='8888', email='*****@*****.**', username='******') with self.assertRaises(UserProfile.MultipleObjectsReturned): views.find_user({'uid': '9999', 'email': '*****@*****.**'})
def test_user_exists_with_both(self): user = UserProfile.objects.create(fxa_id='9999', email='*****@*****.**') found_user = views.find_user({'uid': '9999', 'email': '*****@*****.**'}) assert user == found_user