Skip to content

Commit

Permalink
[deps] Added support for djangorestframework<=3.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Aug 16, 2024
1 parent bbfdbdb commit 279f7b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/testapp/tests/test_filter_classes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from packaging.version import parse as version_parse
from rest_framework import VERSION as REST_FRAMEWORK_VERSION
from swapper import load_model

from openwisp_users.api.throttling import AuthRateThrottle
Expand Down Expand Up @@ -312,7 +314,10 @@ def test_shelf_with_read_only_org_field(self):
self.client.force_login(operator)
self._create_shelf(name='test-shelf-a', organization=org1)
path = reverse('test_shelf_list_with_read_only_org')
with self.assertNumQueries(7):
expected_queries = (
6 if version_parse(REST_FRAMEWORK_VERSION) > version_parse('3.14') else 7
)
with self.assertNumQueries(expected_queries):
response = self.client.get(path, {'format': 'api'})
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data[0]['organization'], org1.pk)
Expand Down

0 comments on commit 279f7b7

Please sign in to comment.