Ejemplo n.º 1
0
 def test_get_empty_models_if_spec_in_conf(self):
     old_value = conf.AUTO_ADMIN_READONLY_CT
     conf.AUTO_ADMIN_READONLY_CT = ()
     tools.assert_equals([], get_models())
     conf.AUTO_ADMIN_READONLY_CT = old_value
Ejemplo n.º 2
0
 def test_get_all_models_if_spec_in_conf(self):
     old_value = conf.AUTO_ADMIN_READONLY_CT
     conf.AUTO_ADMIN_READONLY_CT = '__all__'
     tools.assert_equals(apps.get_models(), get_models())
     conf.AUTO_ADMIN_READONLY_CT = old_value
Ejemplo n.º 3
0
 def test_get_models_for_content_types_spec_in_settings(self):
     tools.assert_equals([
         ContentType.objects.get_by_natural_key(
             *settings.ADMIN_EXTRAS_AUTO_ADMIN_READONLY_CT[0].split(
                 '.')).model_class()
     ], get_models())
Ejemplo n.º 4
0
 def test_get_empty_models_if_spec_in_conf(self):
     old_value = conf.AUTO_ADMIN_READONLY_CT
     conf.AUTO_ADMIN_READONLY_CT = ()
     tools.assert_equals([], get_models())
     conf.AUTO_ADMIN_READONLY_CT = old_value
Ejemplo n.º 5
0
 def test_get_all_models_if_spec_in_conf(self):
     old_value = conf.AUTO_ADMIN_READONLY_CT
     conf.AUTO_ADMIN_READONLY_CT = '__all__'
     tools.assert_equals(apps.get_models(), get_models())
     conf.AUTO_ADMIN_READONLY_CT = old_value
Ejemplo n.º 6
0
 def test_get_models_for_content_types_spec_in_settings(self):
     tools.assert_equals(
         [ContentType.objects.get_by_natural_key(*settings.ADMIN_EXTRAS_AUTO_ADMIN_READONLY_CT[0].split('.')).model_class()],
         get_models()
     )