Commit 96d1d4e2 authored by Tim Graham's avatar Tim Graham
Browse files

Removed unused local variables in tests.

parent 5f525903
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh

[flake8]
exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py
ignore=E124,E125,E126,E127,E128,E225,E226,E241,E251,E302,E501,E203,E221,E227,E231,E261,E301,F401,F403,F841,W601
ignore=E124,E125,E126,E127,E128,E225,E226,E241,E251,E302,E501,E203,E221,E227,E231,E261,E301,F401,F403,W601

[metadata]
license-file = LICENSE
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ class DeprecatingRequestMergeDictTest(SimpleTestCase):
        with warnings.catch_warnings(record=True) as recorded:
            warnings.simplefilter('always')
            request = RequestFactory().get('/')
            _ = request.REQUEST
            request.REQUEST  # evaluate

            msgs = [str(warning.message) for warning in recorded]
            self.assertEqual(msgs, [
+5 −5
Original line number Diff line number Diff line
@@ -351,7 +351,7 @@ class FTimeDeltaTests(TestCase):
    def test_delta_invalid_op_mult(self):
        raised = False
        try:
            r = repr(Experiment.objects.filter(end__lt=F('start')*self.deltas[0]))
            repr(Experiment.objects.filter(end__lt=F('start')*self.deltas[0]))
        except TypeError:
            raised = True
        self.assertTrue(raised, "TypeError not raised on attempt to multiply datetime by timedelta.")
@@ -359,7 +359,7 @@ class FTimeDeltaTests(TestCase):
    def test_delta_invalid_op_div(self):
        raised = False
        try:
            r = repr(Experiment.objects.filter(end__lt=F('start')/self.deltas[0]))
            repr(Experiment.objects.filter(end__lt=F('start')/self.deltas[0]))
        except TypeError:
            raised = True
        self.assertTrue(raised, "TypeError not raised on attempt to divide datetime by timedelta.")
@@ -367,7 +367,7 @@ class FTimeDeltaTests(TestCase):
    def test_delta_invalid_op_mod(self):
        raised = False
        try:
            r = repr(Experiment.objects.filter(end__lt=F('start') % self.deltas[0]))
            repr(Experiment.objects.filter(end__lt=F('start') % self.deltas[0]))
        except TypeError:
            raised = True
        self.assertTrue(raised, "TypeError not raised on attempt to modulo divide datetime by timedelta.")
@@ -375,7 +375,7 @@ class FTimeDeltaTests(TestCase):
    def test_delta_invalid_op_and(self):
        raised = False
        try:
            r = repr(Experiment.objects.filter(end__lt=F('start').bitand(self.deltas[0])))
            repr(Experiment.objects.filter(end__lt=F('start').bitand(self.deltas[0])))
        except TypeError:
            raised = True
        self.assertTrue(raised, "TypeError not raised on attempt to binary and a datetime with a timedelta.")
@@ -383,7 +383,7 @@ class FTimeDeltaTests(TestCase):
    def test_delta_invalid_op_or(self):
        raised = False
        try:
            r = repr(Experiment.objects.filter(end__lt=F('start').bitor(self.deltas[0])))
            repr(Experiment.objects.filter(end__lt=F('start').bitor(self.deltas[0])))
        except TypeError:
            raised = True
        self.assertTrue(raised, "TypeError not raised on attempt to binary or a datetime with a timedelta.")
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ class ExtraRegressTests(TestCase):
        columns, we can (and should) ignore those columns. They don't change
        the result and cause incorrect SQL to be produced otherwise.
        """
        rm = RevisionableModel.objects.create(
        RevisionableModel.objects.create(
            title='First Revision',
            when=datetime.datetime(2008, 9, 28, 10, 30, 0)
        )
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ class FieldDeconstructionTests(TestCase):
        self.assertEqual(kwargs, {})

    def test_ip_address_field(self):
        with warnings.catch_warnings(record=True) as w:
        with warnings.catch_warnings(record=True):
            warnings.simplefilter("always")
            field = models.IPAddressField()
        name, path, args, kwargs = field.deconstruct()
Loading