diff options
author | Rust Saiargaliev <rustem.saiargaliev@thermondo.de> | 2021-05-18 12:53:02 +0200 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-05-18 12:54:51 +0200 |
commit | f07723aa0a094d55cc47417492046d613c6ab349 (patch) | |
tree | e246405bf68ea3cdaf4827a07358a41c0dd9f92f /tests/check_framework | |
parent | 27d4573d35935bff83c28bfd68a2ce5a7a6c600a (diff) | |
download | django-f07723aa0a094d55cc47417492046d613c6ab349.tar.gz |
Refs #31007 -- Added test for check for specifying type of auto-created primary keys from abstract models.
Diffstat (limited to 'tests/check_framework')
-rw-r--r-- | tests/check_framework/test_model_checks.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/check_framework/test_model_checks.py b/tests/check_framework/test_model_checks.py index ad3bf1f8b1..cf0aca404f 100644 --- a/tests/check_framework/test_model_checks.py +++ b/tests/check_framework/test_model_checks.py @@ -434,6 +434,18 @@ class ModelDefaultAutoFieldTests(SimpleTestCase): Warning(self.msg, hint=self.hint, obj=Parent, id='models.W042'), ]) + def test_auto_created_pk_inherited_abstract_parent(self): + class Parent(models.Model): + class Meta: + abstract = True + + class Child(Parent): + pass + + self.assertEqual(checks.run_checks(app_configs=self.apps.get_app_configs()), [ + Warning(self.msg, hint=self.hint, obj=Child, id='models.W042'), + ]) + @override_settings(DEFAULT_AUTO_FIELD='django.db.models.BigAutoField') def test_default_auto_field_setting(self): class Model(models.Model): |