﻿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
10868	_destroy_test_db exposes the production database to possibly destructive actions from the unit tests	ovidiu	nobody	"Latest SVN trunk, file django.db.backends.creation.py

{{{
414        cursor = self.connection.cursor()
415        self.set_autocommit()
416        time.sleep(1) # To avoid ""database is being accessed by other users"" errors.
417        cursor.execute(""DROP DATABASE %s"" % self.connection.ops.quote_name(test_database_name))
418        self.connection.close()
}}}

At line 414 django is connected to the production database (the rationale for this is explained in the comment above this code fragment). The connection is closed one second later. If the unit tests involve threads which for some reason become active before the connection is closed then those threads can potentially mess up the production database."	Bug	closed	Testing framework		Release blocker	fixed	django.test	Adrian Holovaty anssi.kaariainen@…	Ready for checkin	1	0	0	0	0	0
