Skip to content

Commit 1745a0a

Browse files
committed
[tests] Updated expected queries in pki tests
Due to changes in django-x509 and DRF.
1 parent a42c4fc commit 1745a0a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

openwisp_controller/pki/tests/test_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_ca_post_api(self):
4747
self.assertEqual(Ca.objects.count(), 0)
4848
path = reverse('pki_api:ca_list')
4949
data = self._get_ca_data.copy()
50-
with self.assertNumQueries(5):
50+
with self.assertNumQueries(4):
5151
r = self.client.post(path, data, content_type='application/json')
5252
self.assertEqual(r.status_code, 201)
5353
self.assertEqual(Ca.objects.count(), 1)
@@ -57,7 +57,7 @@ def test_ca_post_with_extensions_field(self):
5757
path = reverse('pki_api:ca_list')
5858
data = self._get_ca_data.copy()
5959
data['extensions'] = []
60-
with self.assertNumQueries(5):
60+
with self.assertNumQueries(4):
6161
r = self.client.post(path, data, content_type='application/json')
6262
self.assertEqual(r.status_code, 201)
6363
self.assertEqual(r.data['extensions'], [])
@@ -93,7 +93,7 @@ def test_ca_post_with_date_none_api(self):
9393
'validity_start': None,
9494
'validity_end': None,
9595
}
96-
with self.assertNumQueries(5):
96+
with self.assertNumQueries(4):
9797
r = self.client.post(path, data, content_type='application/json')
9898
self.assertEqual(r.status_code, 201)
9999
self.assertEqual(Ca.objects.count(), 1)
@@ -168,7 +168,7 @@ def test_cert_post_api(self):
168168
path = reverse('pki_api:cert_list')
169169
data = self._get_cert_data.copy()
170170
data['ca'] = self._create_ca().pk
171-
with self.assertNumQueries(11):
171+
with self.assertNumQueries(8):
172172
r = self.client.post(path, data, content_type='application/json')
173173
self.assertEqual(r.status_code, 201)
174174
self.assertEqual(Cert.objects.count(), 1)
@@ -201,7 +201,7 @@ def test_cert_post_with_extensions_field(self):
201201
data = self._get_cert_data.copy()
202202
data['ca'] = self._create_ca().pk
203203
data['extensions'] = []
204-
with self.assertNumQueries(11):
204+
with self.assertNumQueries(8):
205205
r = self.client.post(path, data, content_type='application/json')
206206
self.assertEqual(r.status_code, 201)
207207
self.assertEqual(Cert.objects.count(), 1)
@@ -217,7 +217,7 @@ def test_cert_post_with_date_none(self):
217217
'validity_start': None,
218218
'validity_end': None,
219219
}
220-
with self.assertNumQueries(11):
220+
with self.assertNumQueries(8):
221221
r = self.client.post(path, data, content_type='application/json')
222222
self.assertEqual(r.status_code, 201)
223223
self.assertEqual(Cert.objects.count(), 1)

0 commit comments

Comments
 (0)