﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31123	remove_stale_contenttypes doesn't remove entries for stale apps	Gowtham Kommineni	nobody	"remove_stale_contenttypes only removes stale content types for stale models in installed apps. It doesn't remove stale content types whose app was either removed or renamed.

Test:
Comment out the line that limits the available apps.
# Speed up tests by avoiding retrieving ContentTypes for all test apps.
# available_apps = ['contenttypes_tests', 'no_models', 'django.contrib.contenttypes']

def test_contenttypes_removed_for_apps_not_in_installed_apps(self):
        ContentType.objects.create(app_label='stale_app', model='Fake')
        with mock.patch('builtins.input', return_value='yes'), captured_stdout() as stdout:
            call_command('remove_stale_contenttypes', verbosity=2)
        self.assertIn(""Deleting stale content type 'stale_app | Fake'"", stdout.getvalue())
        self.assertEqual(ContentType.objects.count(), self.before_count)"	Bug	new	contrib.contenttypes	3.0	Normal				Unreviewed	1	0	0	0	0	0
