diff --git a/pytest_plugin/collect.py b/pytest_plugin/collect.py index ded17b2..1fbcd1f 100644 --- a/pytest_plugin/collect.py +++ b/pytest_plugin/collect.py @@ -26,10 +26,8 @@ class NewSemanalDjangoTestItem(YamlTestItem): installed_apps = self.parsed_test_data.get('installed_apps', None) if installed_apps is not None: - if not installed_apps: - installed_apps_as_str = '()' - else: - installed_apps_as_str = '(' + ','.join([repr(app) for app in installed_apps]) + ',)' + installed_apps += ['django.contrib.contenttypes'] + installed_apps_as_str = '(' + ','.join([repr(app) for app in installed_apps]) + ',)' pyproject_toml_file = File(path='pyproject.toml', content='[tool.django-stubs]\ndjango_settings_module=\'mysettings\'') diff --git a/test-data/typecheck/fields/test_generic_foreign_key.yml b/test-data/typecheck/fields/test_generic_foreign_key.yml index a05f5e3..d0979a8 100644 --- a/test-data/typecheck/fields/test_generic_foreign_key.yml +++ b/test-data/typecheck/fields/test_generic_foreign_key.yml @@ -8,7 +8,6 @@ Tag.objects.create(content_object=myuser) reveal_type(Tag().content_object) # N: Revealed type is 'Union[Any, None]' installed_apps: - - django.contrib.contenttypes - myapp files: - path: myapp/__init__.py diff --git a/test-data/typecheck/fields/test_related.yml b/test-data/typecheck/fields/test_related.yml index e22a60c..9263028 100644 --- a/test-data/typecheck/fields/test_related.yml +++ b/test-data/typecheck/fields/test_related.yml @@ -25,7 +25,6 @@ reveal_type(book.publisher_id) # N: Revealed type is 'builtins.int*' reveal_type(book.owner_id) # N: Revealed type is 'builtins.int*' installed_apps: - - django.contrib.contenttypes - django.contrib.auth - myapp files: diff --git a/test-data/typecheck/test_config.yml b/test-data/typecheck/test_config.yml index b9698f4..1f9df4f 100644 --- a/test-data/typecheck/test_config.yml +++ b/test-data/typecheck/test_config.yml @@ -30,7 +30,6 @@ mymodel = MyModel(user_id=1) reveal_type(mymodel.id) # N: Revealed type is 'builtins.int*' installed_apps: - - django.contrib.contenttypes - django.contrib.auth - myapp files: