예제 #1
0
 def test_create_userprofile_is_not_new(self):
     """ Test, that call with is_new=False doesn't create profile """
     user = mommy.make("User")
     create_userprofile(None, None, {}, user, is_new=False)
     self.assertFalse(hasattr(user, 'userprofile'))
예제 #2
0
 def test_create_userprofile_null_sex(self):
     user = mommy.make("User")
     response = {}
     create_userprofile(None, None, response, user, is_new=True)
     self.assertEqual(user.userprofile.sex, 'unknown')
예제 #3
0
 def test_create_userprofile_null_user(self):
     """ Test, that call with null user doesn't cause exception """
     create_userprofile(None, None, {}, None, is_new=True)
예제 #4
0
 def test_create_userprofile(self):
     user = mommy.make("User")
     response = {'gender': 'male'}
     create_userprofile(None, None, response, user, is_new=True)
     self.assertEqual(user.userprofile.sex, 'male')