Пример #1
0
 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
     )
Пример #2
0
 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
     )
Пример #3
0
 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
     )
Пример #4
0
 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
     )