Ejemplo n.º 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'))
Ejemplo n.º 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')
Ejemplo n.º 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)
Ejemplo n.º 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')