Ticket #36942: check_mro.py

File check_mro.py, 705 bytes (added by Michele Fiori, 5 hours ago)
Line 
1import os
2from django.conf import settings
3from django.db import connections
4from django.test import SimpleTestCase
5if not settings.configured:
6 settings.configure(
7 DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'},
8 'other': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}},
9 INSTALLED_APPS=[],
10 )
11class BuggyTest(SimpleTestCase):
12 databases = {'default'}
13def reproduce():
14 BuggyTest.setUpClass()
15 print("First cleanup...")
16 BuggyTest._remove_databases_failures()
17 print("Second cleanup (should crash without fix)...")
18 BuggyTest._remove_databases_failures()
19if __name__ == "__main__":
20 reproduce()
Back to Top