﻿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
32939	Permit override_settings to work with test class mixins that don't inherit from unittest.TestCase	Chris Jerdonek	Jonathan Wang	"Currently, the `@override_settings` decorator raises a `ValueError` if it's used to decorate a class that doesn't inherit from `SimpleTestCase`:
https://github.com/django/django/blob/56f9579105c324ff15250423bf9f8bdf1634cfb4/django/test/utils.py#L519-L521

However, this prevents the decorator from being useable as a test-class mixin for a number of `SimpleTestCase` subclasses. When creating shared test-class functionality, it's often better to use a mixin rather than a concrete `TestCase` class. This way the mixin won't have its `setUp` methods run unnecessarily on a test-case class with no tests, and it won't count towards the parallel test runner's test-case class count, etc.

The check could instead be done lazily, e.g. inside `setUpClass()`, while still having the same desired effect.

I noticed this when seeing if I could convert [https://github.com/django/django/blob/56f9579105c324ff15250423bf9f8bdf1634cfb4/tests/auth_tests/test_views.py#L46 AuthViewsTestCase] into a mixin. This `AuthViewsTestCase` change could be done in a nicer way once this ticket is implemented, perhaps even as part of this ticket.
"	Cleanup/optimization	assigned	Testing framework	dev	Normal			Florian Demmer	Accepted	0	0	0	0	0	0
