Beispiel #1
0
 def test_get_send_without_auth_header(self):
     """
     Test to get campaign send without auth header. It should get 'error' in JSON response.
     """
     query = {
         'query': self.query_string % (fake.random_int(), fake.random_int())
     }
     response = requests.get(GRAPHQL_BASE_URL, data=query)
     assert response.status_code == requests.codes.ok
     assert response.json()['errors']
Beispiel #2
0
 def test_get_send_of_non_existing_campaign(self, access_token_first):
     """
     Test to get send of non-existing email-campaign. It should not get any send object.
     """
     query = {
         'query':
         self.query_string %
         (CampaignsTestsHelpers.get_non_existing_id(EmailCampaign),
          fake.random_int())
     }
     response = send_request('get',
                             GRAPHQL_BASE_URL,
                             access_token_first,
                             data=query)
     assert response.status_code == requests.codes.ok
     assert 'errors' in response.json()
     assert response.json()['data']['email_campaign_query']['send'] is None