|
@@ -38,6 +38,9 @@ class TunnelGroupTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
bulk_update_data = {
|
|
bulk_update_data = {
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'owner': 99999,
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpTestData(cls):
|
|
def setUpTestData(cls):
|
|
@@ -58,6 +61,9 @@ class TunnelTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
'encapsulation': TunnelEncapsulationChoices.ENCAP_GRE,
|
|
'encapsulation': TunnelEncapsulationChoices.ENCAP_GRE,
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'status': 'not-a-valid-status',
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpTestData(cls):
|
|
def setUpTestData(cls):
|
|
@@ -117,6 +123,9 @@ class TunnelTerminationTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
bulk_update_data = {
|
|
bulk_update_data = {
|
|
|
'role': TunnelTerminationRoleChoices.ROLE_PEER,
|
|
'role': TunnelTerminationRoleChoices.ROLE_PEER,
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'role': 'not-a-valid-role',
|
|
|
|
|
+ }
|
|
|
user_permissions = ('vpn.view_tunnel', )
|
|
user_permissions = ('vpn.view_tunnel', )
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -189,6 +198,9 @@ class IKEProposalTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
'group': DHGroupChoices.GROUP_19,
|
|
'group': DHGroupChoices.GROUP_19,
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'authentication_algorithm': 'not-a-valid-authentication-algorithm',
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpTestData(cls):
|
|
def setUpTestData(cls):
|
|
@@ -252,6 +264,9 @@ class IKEPolicyTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
'preshared_key': 'New key',
|
|
'preshared_key': 'New key',
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'version': 'not-a-valid-version',
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpTestData(cls):
|
|
def setUpTestData(cls):
|
|
@@ -325,6 +340,9 @@ class IPSecProposalTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
'authentication_algorithm': AuthenticationAlgorithmChoices.AUTH_HMAC_MD5,
|
|
'authentication_algorithm': AuthenticationAlgorithmChoices.AUTH_HMAC_MD5,
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'encryption_algorithm': 'not-a-valid-encryption-algorithm',
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpTestData(cls):
|
|
def setUpTestData(cls):
|
|
@@ -374,6 +392,9 @@ class IPSecPolicyTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
'pfs_group': DHGroupChoices.GROUP_5,
|
|
'pfs_group': DHGroupChoices.GROUP_5,
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'pfs_group': 'not-a-valid-pfs-group',
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpTestData(cls):
|
|
def setUpTestData(cls):
|
|
@@ -519,6 +540,10 @@ class IPSecProfileTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ cls.bulk_update_invalid_data = {
|
|
|
|
|
+ 'mode': 'not-a-valid-mode',
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class L2VPNTestCase(APIViewTestCases.APIViewTestCase):
|
|
class L2VPNTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
model = L2VPN
|
|
model = L2VPN
|
|
@@ -549,6 +574,9 @@ class L2VPNTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
bulk_update_data = {
|
|
bulk_update_data = {
|
|
|
'description': 'New description',
|
|
'description': 'New description',
|
|
|
}
|
|
}
|
|
|
|
|
+ bulk_update_invalid_data = {
|
|
|
|
|
+ 'status': 'not-a-valid-status',
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpTestData(cls):
|
|
def setUpTestData(cls):
|
|
@@ -656,3 +684,7 @@ class L2VPNTerminationTestCase(APIViewTestCases.APIViewTestCase):
|
|
|
cls.bulk_update_data = {
|
|
cls.bulk_update_data = {
|
|
|
'l2vpn': l2vpns[2].pk
|
|
'l2vpn': l2vpns[2].pk
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ cls.bulk_update_invalid_data = {
|
|
|
|
|
+ 'l2vpn': 99999,
|
|
|
|
|
+ }
|