Bläddra i källkod

tests(api): ensure that no-op dyn RRset operations don't touch pdns

Peter Thomassen 6 år sedan
förälder
incheckning
dff4795310
1 ändrade filer med 27 tillägg och 0 borttagningar
  1. 27 0
      api/desecapi/tests/test_dyndns12update.py

+ 27 - 0
api/desecapi/tests/test_dyndns12update.py

@@ -70,6 +70,19 @@ class DynDNS12UpdateTest(DynDomainOwnerTestCase):
             self.assertEqual(response.data, 'good')
             self.assertIP(ipv4='10.1.2.3')
 
+        # Repeat and make sure that no pdns request is made (not even for the empty AAAA record)
+        response = self.client.get(
+            self.reverse('v1:dyndns12update'),
+            {
+                'action': 'edit',
+                'started': 1,
+                'hostname': 'YES',
+                'host_id': self.my_domain.name,
+                'myip': '10.1.2.3'
+            }
+        )
+        self.assertStatus(response, status.HTTP_200_OK)
+
     def test_ddclient_dyndns1_v6_success(self):
         # /nic/dyndns?action=edit&started=1&hostname=YES&host_id=foobar.dedyn.io&myipv6=::1337
         response = self.assertDynDNS12Update(
@@ -84,6 +97,20 @@ class DynDNS12UpdateTest(DynDomainOwnerTestCase):
         self.assertEqual(response.data, 'good')
         self.assertIP(ipv4='127.0.0.1', ipv6='::1337')
 
+        # Repeat and make sure that no pdns request is made (not even for the empty A record)
+        response = self.client.get(
+            self.reverse('v1:dyndns12update'),
+            {
+                'domain_name': self.my_domain.name,
+                'action': 'edit',
+                'started': 1,
+                'hostname': 'YES',
+                'host_id': self.my_domain.name,
+                'myipv6': '::1337'
+        }
+        )
+        self.assertStatus(response, status.HTTP_200_OK)
+
     def test_ddclient_dyndns2_v4_success(self):
         # /nic/update?system=dyndns&hostname=foobar.dedyn.io&myip=10.2.3.4
         response = self.assertDynDNS12Update(