Put declaration in test class

This commit is contained in:
Sébastien Corbin 2019-08-12 18:49:00 +02:00 committed by GitHub
parent 504530aee2
commit 956502757a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -690,7 +690,9 @@ class SensitiveOrderingFilterTests(TestCase):
]
if postgres_fields:
@pytest.mark.skipif('not postgres_fields')
class JSONOrderingFilterTests(TestCase):
def test_order_by_json_field(self):
class JSONOrderingFilterModel(models.Model):
data = postgres_fields.JSONField()
@ -700,11 +702,6 @@ if postgres_fields:
model = JSONOrderingFilterModel
fields = '__all__'
@pytest.mark.skipif(postgres_fields is None, reason='not a postgresql database')
class JSONOrderingFilterTests(TestCase):
def test_order_by_json_field(self):
class OrderingListView(generics.ListAPIView):
queryset = JSONOrderingFilterModel.objects.all()
serializer_class = JSONOrderingFilterSerializer