def test_create_post_customer_without_required_field(self):
        url = reverse('customer-list')

        required_fields = ['name', 'address_1', 'city', 'country']

        for field in required_fields:
            temp_data = self.complete_data.copy()
            try:
                temp_data.pop(field)
            except __HOLE__:
                pytest.xfail('Customer required field %s not provided in the'
                             'complete test data.' % field)

            response = self.client.post(url, json.dumps(temp_data),
                                        content_type='application/json')

            self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
            assert (response.data == {field: ['This field may not be blank.']}
                    or response.data == {field: ['This field is required.']})
dataset/ETHPy150Open PressLabs/silver/silver/tests/spec/test_customer.py/TestCustomerEndpoints.test_create_post_customer_without_required_field