|
@@ -13,7 +13,7 @@ class VPNTestCase(TestCase):
|
|
|
def setUp(self):
|
|
|
self.v6_pool = IPPool.objects.get(default_subnetsize=56)
|
|
|
self.v4_pool = IPPool.objects.get(default_subnetsize=32)
|
|
|
- self.offer = Offer.objects.filter(backend="openvpn_ldap")[0]
|
|
|
+ self.offer = Offer.objects.filter(configuration_type="VPNConfiguration")[0]
|
|
|
|
|
|
# Create a member.
|
|
|
cn = MemberTestsUtils.get_random_ldap_cn()
|
|
@@ -32,7 +32,7 @@ class VPNTestCase(TestCase):
|
|
|
v4 = IPSubnet(ip_pool=self.v4_pool, offer_subscription=abo)
|
|
|
v4.full_clean()
|
|
|
v4.save()
|
|
|
- vpn = VPNConfiguration(administrative_subscription=abo)
|
|
|
+ vpn = VPNConfiguration(offersubscription=abo)
|
|
|
vpn.full_clean()
|
|
|
vpn.save()
|
|
|
|
|
@@ -42,7 +42,7 @@ class VPNTestCase(TestCase):
|
|
|
abo = OfferSubscription(offer=self.offer, member=self.member)
|
|
|
abo.full_clean()
|
|
|
abo.save()
|
|
|
- vpn = VPNConfiguration(administrative_subscription=abo)
|
|
|
+ vpn = VPNConfiguration(offersubscription=abo)
|
|
|
vpn.full_clean()
|
|
|
vpn.save()
|
|
|
|
|
@@ -60,7 +60,7 @@ class VPNTestCase(TestCase):
|
|
|
"""If there is not endpoint, we consider it to be correct."""
|
|
|
vpn = VPNConfiguration.objects.all()[0]
|
|
|
if vpn.ipv4_endpoint is not None:
|
|
|
- abo = vpn.administrative_subscription
|
|
|
+ abo = vpn.offersubscription
|
|
|
subnet = abo.ip_subnet.get(ip_pool=self.v4_pool)
|
|
|
self.assertIn(vpn.ipv4_endpoint, subnet.inet)
|
|
|
|
|
@@ -72,7 +72,7 @@ class VPNTestCase(TestCase):
|
|
|
"""If there is not endpoint, we consider it to be correct."""
|
|
|
vpn = VPNConfiguration.objects.all()[0]
|
|
|
if vpn.ipv6_endpoint is not None:
|
|
|
- abo = vpn.administrative_subscription
|
|
|
+ abo = vpn.offersubscription
|
|
|
subnet = abo.ip_subnet.get(ip_pool=self.v6_pool)
|
|
|
self.assertIn(vpn.ipv6_endpoint, subnet.inet)
|
|
|
|
|
@@ -94,7 +94,7 @@ class VPNTestCase(TestCase):
|
|
|
|
|
|
def test_automatic_login(self):
|
|
|
vpn = VPNConfiguration.objects.all()[0]
|
|
|
- expected_login = vpn.administrative_subscription.member.ldap_cn + "-vpn1"
|
|
|
+ expected_login = vpn.offersubscription.member.ldap_cn + "-vpn1"
|
|
|
self.assertEqual(vpn.login, expected_login)
|
|
|
|
|
|
def test_has_multiple_vpn(self):
|