def test_user_profile(self): UserModel = get_user_model() user = UserModel(first_name='Sviatoslav', last_name='') instance = models.UserProfile() instance.user = user self.assertEqual(str(instance), 'User profile for Sviatoslav') user = UserModel(first_name='Sventoslav\u016d') instance = models.UserProfile() instance.user = user self.assertEqual(str(instance), 'User profile for Sventoslav\u016d')
def test_last_name(self): p = models.UserProfile(user=self.user) self.assertEqual(p.last_name(), "Last")
def test_middle_name(self): p = models.UserProfile(user=self.user) self.assertEqual(p.middle_name(), "Middle")
def test_first_name(self): p = models.UserProfile(user=self.user) self.assertEqual(p.first_name(), "First")
def test_email(self): p = models.UserProfile(user=self.user) self.assertEqual(p.email(), "*****@*****.**")