Esempio n. 1
0
 def test_model_name_too_long(self):
     model = type('A' * 101, (models.Model,), {'__module__': self.__module__})
     self.assertEqual(check_model_name_lengths(self.apps.get_app_configs()), [
         checks.Error(
             'Model names must be at most 100 characters (got 101).',
             obj=model,
             id='contenttypes.E005',
         )
     ])
Esempio n. 2
0
 def test_model_name_too_long(self):
     model = type('A' * 101, (models.Model, ),
                  {'__module__': self.__module__})
     self.assertEqual(check_model_name_lengths(
         self.apps.get_app_configs()), [
             checks.Error(
                 'Model names must be at most 100 characters (got 101).',
                 obj=model,
                 id='contenttypes.E005',
             )
         ])
Esempio n. 3
0
 def test_model_name_too_long(self):
     model = type("A" * 101, (models.Model,), {"__module__": self.__module__})
     self.assertEqual(
         check_model_name_lengths(self.apps.get_app_configs()),
         [
             checks.Error(
                 "Model names must be at most 100 characters (got 101).",
                 obj=model,
                 id="contenttypes.E005",
             )
         ],
     )
Esempio n. 4
0
 def test_model_name_max_length(self):
     type("A" * 100, (models.Model,), {"__module__": self.__module__})
     self.assertEqual(check_model_name_lengths(self.apps.get_app_configs()), [])
Esempio n. 5
0
 def test_model_name_max_length(self):
     type('A' * 100, (models.Model,), {'__module__': self.__module__})
     self.assertEqual(check_model_name_lengths(self.apps.get_app_configs()), [])