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