def setUp(self): self.shipper_user, self.shipper = createUser(True) self.carrier_user, self.carrier = createUser(False) self.client = setAuthClient(self.carrier_user) another_user = User.objects.create(email='*****@*****.**', first_name='carrier 2', last_name='teste', password='******') another_carrier = CarrierUser.objects.create(user=another_user, MC_number=456) another_carrier.save() self.obj = Load(pickup_date='2019-04-17', ref=123, origin_city='Miami Gardens, FL, USA', destination_city='Florida City, FL, USA', price=50.0, status="accepted", suggested_price=67.04, shipper=self.shipper, carrier=another_carrier) self.obj.save() self.response = self.client.put(r('api:accept_load', pk_load=self.obj.pk), format='json')
def setUp(self): self.shipper_user, self.shipper = createUser(True) self.carrier_user, self.carrier = createUser(False) self.client = setAuthClient(self.carrier_user) self.obj = Load(pickup_date='2019-04-17', ref=123, origin_city='Miami Gardens, FL, USA', destination_city='Florida City, FL, USA', price=50.0, status="accepted", suggested_price=67.04, shipper=self.shipper, carrier=self.carrier) self.obj.save() self.response = self.client.get(r('api:list_carrier_accepted'), format='json')
def setUp(self): self.user, self.shipper = createUser(True) self.client = setAuthClient(self.user) self.response = self.client.post(r("api:post_load"), { "pickup_date": "2019-03-19", "ref": 11111, "origin_city": "Miami, FL, USA", "destination_city": "Mesa, AZ, USA", "price": 1111, }, format='json')