Ejemplo n.º 1
0
 def test__returns_many_networks(self):
     subnets = [
         str(factory.make_ipv4_network()) for _ in range(
             random.randint(1, 5))]
     actual_subnets = ' '.join(subnets)
     Config.objects.set_config('dns_trusted_acl', str(actual_subnets))
     expected = [subnet for subnet in subnets]
     # Note: This test was seen randomly failing because the networks were
     # in an unexpected order...
     self.assertItemsEqual(expected, get_trusted_acls())
Ejemplo n.º 2
0
 def test_returns_single_network(self):
     subnet = factory.make_ipv6_network()
     Config.objects.set_config("dns_trusted_acl", str(subnet))
     expected = [str(subnet)]
     self.assertEqual(expected, get_trusted_acls())
Ejemplo n.º 3
0
 def test_returns_empty_string_if_no_networks(self):
     self.assertEqual([], get_trusted_acls())