﻿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
35548	An error in TestCase.setUpTestData() leaks data on databases without transactions	Tim Graham	JaeHyuckSa	"While working on [https://github.com/mongodb-labs/django-mongodb a backend for MongoDB], I found that an exception on [https://github.com/django/django/blob/72b7aecbbfbec0ceb1a829eef82a68d7283df604/tests/expressions/tests.py#L1445 the fourth line] of `expressions.tests.ExpressionsNumericTests.setUpTestData` left `Number` rows in the database such that a later test failed like this:

{{{
======================================================================
ERROR: test_F_reuse (expressions.tests.ExpressionsTests.test_F_reuse)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/home/tim/code/django/tests/expressions/tests.py"", line 1217, in test_F_reuse
    self.assertEqual(n_qs.get(), n)
                     ^^^^^^^^^^
  File ""/home/tim/code/django/django/db/models/query.py"", line 652, in get
    raise self.model.MultipleObjectsReturned(
expressions.models.Number.MultipleObjectsReturned: get() returned more than one Number -- it returned more than 20!
}}}

This is the same problem as #25176 but for databases with `DatabaseFeatures.supports_transactions = False`."	Bug	assigned	Testing framework	dev	Normal				Accepted	1	0	0	0	0	0
