예제 #1
0
 def test_fails_pass_through(self, client_alice, mocked_sensors_fail):
     response = client_alice.get(self.url)
     AssertionHelper.HTTP_404(response, error='404 error')
     mocked_sensors_fail.assert_calls([{
         'path':
         f'/api/v1/device/{self.device.id}/sensor',
         'body':
         '',
         'host':
         settings.PROFILES_URL.replace('http://', ''),
     }])
예제 #2
0
 def test_requires_shipment_relationship(self, client_bob,
                                         mock_non_wallet_owner_calls):
     response = client_bob.get(self.url_wrong_permission)
     AssertionHelper.HTTP_404(response)
예제 #3
0
 def test_random_url_fails(self, client_alice):
     response = client_alice.patch(self.random_url, {'description': 'New Description'})
     AssertionHelper.HTTP_404(response)
예제 #4
0
 def test_random_url_fails(self, client_alice):
     response = client_alice.get(self.random_url)
     AssertionHelper.HTTP_404(response)
예제 #5
0
 def test_other_org(self, client_alice):
     response = client_alice.post(self.url_route_bob, data={'legs': self.insert_order})
     AssertionHelper.HTTP_404(response)
예제 #6
0
 def test_invalid_route(self, client_alice):
     response = client_alice.post(self.url_random, data={'legs': self.insert_order})
     AssertionHelper.HTTP_404(response)
예제 #7
0
 def test_other_org(self, client_alice):
     response = client_alice.delete(self.url_route_bob)
     AssertionHelper.HTTP_404(response, error='Route matching query does not exist')
예제 #8
0
 def test_invalid_leg(self, client_alice):
     response = client_alice.delete(self.url_random_leg)
     AssertionHelper.HTTP_404(response)
예제 #9
0
 def test_invalid_route(self, client_alice):
     response = client_alice.delete(self.url_random_route)
     AssertionHelper.HTTP_404(response, error='Route matching query does not exist')
예제 #10
0
 def test_invalid_route(self, client_alice, leg_attributes):
     response = client_alice.post(self.url_random, data=leg_attributes)
     AssertionHelper.HTTP_404(response, error='Route matching query does not exist')
예제 #11
0
 def test_outside_org_fails(self, client_bob, route_attributes):
     response = client_bob.get(self.url_route, data=route_attributes)
     AssertionHelper.HTTP_404(response)
예제 #12
0
 def test_invalid_route(self, client_alice):
     response = client_alice.get(self.url_random)
     AssertionHelper.HTTP_404(response)
예제 #13
0
 def test_outside_org_fails(self, client_bob, new_route):
     response = client_bob.delete(self.url_route)
     AssertionHelper.HTTP_404(response)
     route = Route.objects.filter(pk=new_route.id).first()
     assert route