diff --git a/django/middleware/locale.py b/django/middleware/locale.py
index cb0bf3f..bcdead5 100644
a
|
b
|
class LocaleMiddleware(object):
|
38 | 38 | def process_response(self, request, response): |
39 | 39 | language = translation.get_language() |
40 | 40 | language_from_path = translation.get_language_from_path( |
41 | | request.path_info, supported=self._supported_languages |
| 41 | request.path_info, supported=self._supported_languages |
42 | 42 | ) |
43 | 43 | if (response.status_code == 404 and not language_from_path |
44 | 44 | and self.is_language_prefix_patterns_used()): |
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index ec99afb..f169457 100644
a
|
b
|
class MailTests(HeadersCheckMixin, SimpleTestCase):
|
324 | 324 | |
325 | 325 | connection = mail.get_connection('mail.custombackend.EmailBackend') |
326 | 326 | send_mass_mail([ |
327 | | ('Subject1', 'Content1', 'from1@example.com', ['to1@example.com']), |
328 | | ('Subject2', 'Content2', 'from2@example.com', ['to2@example.com']), |
329 | | ], connection=connection) |
| 327 | ('Subject1', 'Content1', 'from1@example.com', ['to1@example.com']), |
| 328 | ('Subject2', 'Content2', 'from2@example.com', ['to2@example.com']), |
| 329 | ], connection=connection) |
330 | 330 | self.assertEqual(mail.outbox, []) |
331 | 331 | self.assertEqual(len(connection.test_outbox), 2) |
332 | 332 | self.assertEqual(connection.test_outbox[0].subject, 'Subject1') |
diff --git a/tests/model_formsets_regress/tests.py b/tests/model_formsets_regress/tests.py
index 6715b5b..6669e53 100644
a
|
b
|
class FormfieldShouldDeleteFormTests(TestCase):
|
369 | 369 | DeleteFormset = modelformset_factory(User, form=CustomDeleteUserForm, formset=BaseCustomDeleteModelFormSet) |
370 | 370 | |
371 | 371 | data = { |
372 | | 'form-TOTAL_FORMS': '4', |
373 | | 'form-INITIAL_FORMS': '0', |
374 | | 'form-MAX_NUM_FORMS': '4', |
375 | | 'form-0-username': 'John', |
376 | | 'form-0-serial': '1', |
377 | | 'form-1-username': 'Paul', |
378 | | 'form-1-serial': '2', |
379 | | 'form-2-username': 'George', |
380 | | 'form-2-serial': '3', |
381 | | 'form-3-username': 'Ringo', |
382 | | 'form-3-serial': '5', |
383 | | } |
| 372 | 'form-TOTAL_FORMS': '4', |
| 373 | 'form-INITIAL_FORMS': '0', |
| 374 | 'form-MAX_NUM_FORMS': '4', |
| 375 | 'form-0-username': 'John', |
| 376 | 'form-0-serial': '1', |
| 377 | 'form-1-username': 'Paul', |
| 378 | 'form-1-serial': '2', |
| 379 | 'form-2-username': 'George', |
| 380 | 'form-2-serial': '3', |
| 381 | 'form-3-username': 'Ringo', |
| 382 | 'form-3-serial': '5', |
| 383 | } |
384 | 384 | |
385 | 385 | delete_all_ids = { |
386 | | 'form-0-DELETE': '1', |
387 | | 'form-1-DELETE': '1', |
388 | | 'form-2-DELETE': '1', |
389 | | 'form-3-DELETE': '1', |
390 | | } |
| 386 | 'form-0-DELETE': '1', |
| 387 | 'form-1-DELETE': '1', |
| 388 | 'form-2-DELETE': '1', |
| 389 | 'form-3-DELETE': '1', |
| 390 | } |
391 | 391 | |
392 | 392 | def test_init_database(self): |
393 | 393 | """ Add test data to database via formset """ |
diff --git a/tests/reverse_single_related/tests.py b/tests/reverse_single_related/tests.py
index 472a302..5e5704a 100644
a
|
b
|
class ReverseSingleRelatedTests(TestCase):
|
18 | 18 | private_item = Item.objects.create(source=private_source) |
19 | 19 | |
20 | 20 | # Only one source is available via all() due to the custom default manager. |
21 | | self.assertQuerysetEqual( |
22 | | Source.objects.all(), |
23 | | ["<Source: Source object>"] |
24 | | ) |
| 21 | self.assertQuerysetEqual(Source.objects.all(), ["<Source: Source object>"]) |
25 | 22 | |
26 | 23 | self.assertEqual(public_item.source, public_source) |
27 | 24 | |
diff --git a/tests/serializers_regress/tests.py b/tests/serializers_regress/tests.py
index a35d785..7e9dd46 100644
a
|
b
|
def naturalKeyTest(format, self):
|
557 | 557 | |
558 | 558 | |
559 | 559 | for format in [ |
560 | | f for f in serializers.get_serializer_formats() |
561 | | if not isinstance(serializers.get_serializer(f), serializers.BadSerializer) |
562 | | ]: |
| 560 | f for f in serializers.get_serializer_formats() |
| 561 | if not isinstance(serializers.get_serializer(f), serializers.BadSerializer) |
| 562 | ]: |
563 | 563 | setattr(SerializerTests, 'test_' + format + '_serializer', curry(serializerTest, format)) |
564 | 564 | setattr(SerializerTests, 'test_' + format + '_natural_key_serializer', curry(naturalKeySerializerTest, format)) |
565 | 565 | setattr(SerializerTests, 'test_' + format + '_serializer_fields', curry(fieldsTest, format)) |
diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py
index a66ffe4..8c0c535 100644
a
|
b
|
class AtomicTests(TransactionTestCase):
|
203 | 203 | with self.assertRaises(DatabaseError): |
204 | 204 | with transaction.atomic(savepoint=False): |
205 | 205 | connection.cursor().execute( |
206 | | "SELECT no_such_col FROM transactions_reporter") |
| 206 | "SELECT no_such_col FROM transactions_reporter") |
207 | 207 | # prevent atomic from rolling back since we're recovering manually |
208 | 208 | self.assertTrue(transaction.get_rollback()) |
209 | 209 | transaction.set_rollback(False) |