Exemplo n.º 1
0
 def test_order_by_params_invalid_fields(self):
     """Test parse of order_by params for invalid fields."""
     order_params = {'subscription_guid': 'asc', 'invalid': 'param'}
     serializer = OCPAzureOrderBySerializer(data=order_params)
     with self.assertRaises(serializers.ValidationError):
         serializer.is_valid(raise_exception=True)
Exemplo n.º 2
0
 def test_parse_order_by_params_success(self):
     """Test parse of a order_by param successfully."""
     order_params = {'instance_type': 'asc'}
     serializer = OCPAzureOrderBySerializer(data=order_params)
     self.assertTrue(serializer.is_valid())
Exemplo n.º 3
0
 def test_order_by_cluster(self):
     """Test order by cluster."""
     order_params = {'cluster': 'asc'}
     serializer = OCPAzureOrderBySerializer(data=order_params)
     self.assertTrue(serializer.is_valid())
Exemplo n.º 4
0
 def test_order_by_node(self):
     """Test order by node."""
     order_params = {'node': 'asc'}
     serializer = OCPAzureOrderBySerializer(data=order_params)
     self.assertTrue(serializer.is_valid())
Exemplo n.º 5
0
 def test_order_by_project(self):
     """Test order by project."""
     order_params = {'project': 'asc'}
     serializer = OCPAzureOrderBySerializer(data=order_params)
     self.assertTrue(serializer.is_valid())