              Author.objects.filter(id=self.a1.id).filter(Q(extra__note=self.n1)|Q(item__note=self.n3)),
              ['<Author: a1>']
          )
          self.assertQuerysetEqual(
                  Author.objects.filter(Q(extra__note=self.n1)|Q(item__note=self.n3)).filter(id=self.a1.id),
              ['<Author: a1>']
          )
  
      def test_ticket6981(self):
          self.assertQuerysetEqual(
 
</s> remove                 Party.objects.filter(when__year=1), [
                        datetime.date(1, 3, 3),
                ],
                attrgetter("when")
 </s> add             Party.objects.filter(when__year=1), [
                datetime.date(1, 3, 3),
            ],
            attrgetter("when") </s> remove                 Item.objects.select_related("child").order_by("name"),
                ["<Item: item1>", "<Item: item2>"]
 </s> add             Item.objects.select_related("child").order_by("name"),
            ["<Item: item1>", "<Item: item2>"] </s> remove                 InternalCertificationAudit._meta.verbose_name_plural,
                'Audits'
 </s> add             InternalCertificationAudit._meta.verbose_name_plural,
            'Audits' </s> remove                     'django.template.loaders.filesystem.Loader',
 </s> add                 'django.template.loaders.filesystem.Loader', </s> remove                 Party.objects.filter(when__year='1'), [
                        datetime.date(1, 3, 3),
                ],
                attrgetter("when")
 </s> add             Party.objects.filter(when__year='1'), [
                datetime.date(1, 3, 3),
            ],
            attrgetter("when")
            Author.objects.filter(Q(extra__note=self.n1)|Q(item__note=self.n3)).filter(id=self.a1.id),
              Author.objects.filter(id=self.a1.id).filter(Q(extra__note=self.n1)|Q(item__note=self.n3)),
              ['<Author: a1>']
          )
          self.assertQuerysetEqual(
            Author.objects.filter(Q(extra__note=self.n1)|Q(item__note=self.n3)).filter(id=self.a1.id),
              ['<Author: a1>']
          )
  
      def test_ticket6981(self):
          self.assertQuerysetEqual(
keep keep keep keep replace keep keep keep keep keep
 Fixed #21288 -- Fixed E126 pep8 warnings 
tests/queries/tests.py