Ticket #21288: E126.diff

File E126.diff, 5.4 KB (added by Tim Graham, 11 years ago)
  • django/middleware/locale.py

    diff --git a/django/middleware/locale.py b/django/middleware/locale.py
    index cb0bf3f..bcdead5 100644
    a b class LocaleMiddleware(object):  
    3838    def process_response(self, request, response):
    3939        language = translation.get_language()
    4040        language_from_path = translation.get_language_from_path(
    41                 request.path_info, supported=self._supported_languages
     41            request.path_info, supported=self._supported_languages
    4242        )
    4343        if (response.status_code == 404 and not language_from_path
    4444                and self.is_language_prefix_patterns_used()):
  • tests/mail/tests.py

    diff --git a/tests/mail/tests.py b/tests/mail/tests.py
    index ec99afb..f169457 100644
    a b class MailTests(HeadersCheckMixin, SimpleTestCase):  
    324324
    325325        connection = mail.get_connection('mail.custombackend.EmailBackend')
    326326        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)
    330330        self.assertEqual(mail.outbox, [])
    331331        self.assertEqual(len(connection.test_outbox), 2)
    332332        self.assertEqual(connection.test_outbox[0].subject, 'Subject1')
  • tests/model_formsets_regress/tests.py

    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):  
    369369    DeleteFormset = modelformset_factory(User, form=CustomDeleteUserForm, formset=BaseCustomDeleteModelFormSet)
    370370
    371371    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    }
    384384
    385385    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    }
    391391
    392392    def test_init_database(self):
    393393        """ Add test data to database via formset """
  • tests/reverse_single_related/tests.py

    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):  
    1818        private_item = Item.objects.create(source=private_source)
    1919
    2020        # 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>"])
    2522
    2623        self.assertEqual(public_item.source, public_source)
    2724
  • tests/serializers_regress/tests.py

    diff --git a/tests/serializers_regress/tests.py b/tests/serializers_regress/tests.py
    index a35d785..7e9dd46 100644
    a b def naturalKeyTest(format, self):  
    557557
    558558
    559559for 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]:
    563563    setattr(SerializerTests, 'test_' + format + '_serializer', curry(serializerTest, format))
    564564    setattr(SerializerTests, 'test_' + format + '_natural_key_serializer', curry(naturalKeySerializerTest, format))
    565565    setattr(SerializerTests, 'test_' + format + '_serializer_fields', curry(fieldsTest, format))
  • tests/transactions/tests.py

    diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py
    index a66ffe4..8c0c535 100644
    a b class AtomicTests(TransactionTestCase):  
    203203            with self.assertRaises(DatabaseError):
    204204                with transaction.atomic(savepoint=False):
    205205                    connection.cursor().execute(
    206                             "SELECT no_such_col FROM transactions_reporter")
     206                        "SELECT no_such_col FROM transactions_reporter")
    207207            # prevent atomic from rolling back since we're recovering manually
    208208            self.assertTrue(transaction.get_rollback())
    209209            transaction.set_rollback(False)
Back to Top