def test_model_class(self): """ Tests `get_app_name()` with a model class as the argument. """ app_name = get_app_name(User) self.assertEqual( app_name, 'auth' # django.contrib.auth )
def test_instance(self): """ Tests `get_app_name()` with a model instance as the argument. """ user = User.objects.create(username='******', email='*****@*****.**', password='******') app_name = get_app_name(user) self.assertEqual( app_name, 'auth' # django.contrib.auth )
def test_instance(self): """ Tests `get_app_name()` with a model instance as the argument. """ user = User.objects.create( username='******', email='*****@*****.**', password='******' ) app_name = get_app_name(user) self.assertEqual( app_name, 'auth' # django.contrib.auth )