Exemple #1
0
 def test_sales_prompts_with_invalid_list(self):
     """
     Test method for creating multiple sales prompts with No list Item
     """
     data = {
         "product_id": [],
         "outlet_id": self.outlet.id,
         "title": "Title1 Coming",
         "description": "Description2 Coming"
     }
     response = self.query_with_token(
         self.access_token_master,
         create_sales_prompts.format(**data))
     self.assertIn("errors", response)
Exemple #2
0
 def test_sales_prompts_with_empty_title(self):
     """
     Test method for creating multiple sales prompts with No list Item
     """
     data = {
         "product_id": self.product.id,
         "outlet_id": self.outlet.id,
         "title": "   ",
         "description": "Description2 Coming"
     }
     response = self.query_with_token(
         self.access_token_master,
         create_sales_prompts.format(**data))
     self.assertIn(
         SALES_ERROR_RESPONSES["title_error"],
         response['errors'][0]['message'])
Exemple #3
0
 def test_sales_prompts_with_invalid_product(self):
     """
     Test method for creating multiple sales prompts with invalid product
     """
     data = {
         "product_id": 300,
         "outlet_id": self.outlet.id,
         "title": "Title1 Coming",
         "description": "Description2 Coming"
     }
     response = self.query_with_token(
         self.access_token_master,
         create_sales_prompts.format(**data))
     self.assertIn(
         PRODUCTS_ERROR_RESPONSES["inexistent_product"].format("300"),
         response['errors'][0]['message'])
Exemple #4
0
 def test_create_sales_prompts(self):
     """Test method for creating sales prompts"""
     data = {
         "product_id": self.product.id,
         "outlet_id": self.outlet.id,
         "title": "Title1 Coming",
         "description": "Description2 Coming"
     }
     response = self.query_with_token(
         self.access_token_master,
         create_sales_prompts.format(**data))
     expected_message = SUCCESS_RESPONSES[
                        "creation_success"].format("Sales prompt 1")
     self.assertEqual(
         expected_message,
         response["data"]["createSalesprompts"]["message"])
     self.assertNotIn("errors", response)