﻿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
24652	SimpleTestCase should prevent execution of database queries	Simon Charette	Simon Charette	"`SimpleTestCase` is a simple subclass of `unittest.TestCase` with added assertion methods to deal with Django related stuff such as the `TestClient`.

While it's [https://docs.djangoproject.com/en/dev/topics/testing/tools/#simpletestcase documented] that `SimpleTestCase` shouldn't be used to test anything related to the ORM, nothing prevent users from doing it in unexpected ways. This can result in hard to detect test isolation issues as we have experienced with the Django test suite.

I suggest to prevent the usage of the ORM during the execution of a `SimpleTestCase` by raising an exception pointing to the usage of `TestCase` (or `TransactionTestCase`) on query execution attempts.

This will also be a good safenet for our internal usage, we should feel confident asking contributors to use `SimpleTestCase` where appropriate to avoid useless transaction wrapping."	Cleanup/optimization	closed	Testing framework	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
