def test_pending_request(self):
     """
     Test that no new request is sent if there is a pending request
     """
     self.query_with_token(self.access_token_master,
                           propose_quantity.format(**self.data))
     response = self.query_with_token(self.access_token_master,
                                      propose_quantity.format(**self.data))
     self.assertIn("pending request", response['errors'][0]['message'])
 def test_proposed_quantity(self):
     """
     Test proposing a quantity to a batch
     """
     response = self.query_with_token(self.access_token_master,
                                      propose_quantity.format(**self.data))
     self.assertIn("sent!",
                   response['data']['proposedQuantity']['notification'])
 def test_decline_proposed_quantity(self):
     """"
     Test method for declining a proposed quantity edit
     """
     self.query_with_token(self.access_token_master,
                           propose_quantity.format(**self.data))
     self.data['value'] = 'false'
     response = self.query_with_token(self.access_token_master,
                                      approve_quantity.format(**self.data))
     self.assertIn("has been declined",
                   response['data']['approveQuantity']['message'])
 def test_approve_product_with_no_proposal(self):
     """"
     Test method for validating product that has not been proposed
     """
     self.query_with_token(self.access_token_master,
                           propose_quantity.format(**self.data))
     self.data['value'] = 'true'
     self.query_with_token(self.access_token_master,
                           approve_quantity.format(**self.data))
     response = self.query_with_token(self.access_token_master,
                                      approve_quantity.format(**self.data))
     self.assertIn(PRODUCTS_ERROR_RESPONSES["inexistent_proposal_error"],
                   response['errors'][0]['message'])