django1/django/contrib
Florian Apolloner 325b03ea84 [1.6.x] Final attempt to solve sporadic test failures.
tearDownClass is not called if setUpClass throws an exception, in our case
this means that LiveServerTestCase leaks LiveServerThread sockets if the
test happens to be skipped later on, and AdminSeleniumWebDriverTestCase
doesn't close it's already open browser window. To prevent this leakage
we catch errors where needed and manually call _tearDownClassInternal.
_tearDownClassInternal should be written as defensively as possible since
it is not allowed to make any assumptions on how far setUpClass got.

This patch should fix the sporadic "Address already in use"-errors on jenkins
and also the "This code isn't under transaction management"-error for sqlite
(also just on jenkins).

After discussion with koniiiik, jezdez, kmtracey, tos9, lifeless, nedbat and
voidspace it was decided that this is the safest approach (thanks to everyone
for their comments and help). Manually calling tearDownClass was shut down
cause we don't know how our users override our classes.

This is a private and very specialized API on purpose and should not be used
without a strong reason!

This patch partially reverts the earlier attempts to fix those issues,
namely:
	2fa0dd73b1 and
	3c5775d36f

Final note: If this patch breaks in a later version of Django, please be
very careful on how you fix it, you might not see test failures locally.
That said, this patch hopefully doesn't produce even more failures.

Backport of 73a610d2a8 from master.
2013-09-17 18:36:32 +02:00
..
admin [1.6.x] Final attempt to solve sporadic test failures. 2013-09-17 18:36:32 +02:00
admindocs Removed several unused imports. 2013-06-19 17:18:40 +02:00
auth [1.6.x] Ensure that passwords are never long enough for a DoS. 2013-09-15 13:46:16 +08:00
comments [1.6.x] Took advantage of django.utils.six.moves.urllib.*. 2013-09-10 21:29:31 +02:00
contenttypes [1.6.x] Fixed #18681 -- GenericInlineModelAdmin.get_formset() no longer bypasses get_fieldsets(). 2013-08-02 10:45:58 -04:00
flatpages Removed several unused imports. 2013-06-19 17:18:40 +02:00
formtools [1.6.x] Updated translation templates 2013-08-16 15:13:31 +02:00
gis [1.6.x] Fixed #21035 -- Changed docs to treat the acronym SQL phonetically. 2013-09-05 20:16:14 -04:00
humanize Fixed #20502 (again) -- More i18n cache flush in tests 2013-06-06 14:28:58 +02:00
messages [1.6.x] Fixed #20922 -- Allowed customizing the serializer used by contrib.sessions 2013-08-22 17:55:01 -04:00
redirects Updated translation templates and removed en translations 2013-05-02 16:25:23 +02:00
sessions [1.6.x] Fixed #20922 -- Allowed customizing the serializer used by contrib.sessions 2013-08-22 17:55:01 -04:00
sitemaps [1.6.x] Took advantage of django.utils.six.moves.urllib.*. 2013-09-10 21:29:31 +02:00
sites Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields 2013-06-18 08:01:17 -04:00
staticfiles [1.6.x] Took advantage of django.utils.six.moves.urllib.*. 2013-09-10 21:29:31 +02:00
syndication Stopped using non-standard __globals__ and __code__ attributes. 2013-03-17 10:44:28 +01:00
webdesign Fixed #18269 -- Applied unicode_literals for Python 3 compatibility. 2012-06-07 18:08:47 +02:00
__init__.py Created django.contrib and moved comments into it 2005-07-14 18:20:03 +00:00