|
3 | 3 | from pyactiveresource.activeresource import ActiveResource
|
4 | 4 |
|
5 | 5 | class FulFillmentEventTest(TestCase):
|
6 |
| - def setUp(self): |
7 |
| - super(FulFillmentEventTest, self).setUp() |
8 |
| - self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='GET', body=self.load_fixture('fulfillment_event')) |
9 |
| - self.fulfillment_event = shopify.FulfillmentEvent.find(order_id=2776493818019, fulfillment_id=2608403447971) |
10 |
| - |
11 | 6 | def test_get_fulfillment_event(self):
|
12 |
| - self.assertEqual(1, len(self.fulfillment_event)) |
| 7 | + self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='GET', body=self.load_fixture('fulfillment_event')) |
| 8 | + fulfillment_event = shopify.FulfillmentEvent.find(order_id=2776493818019, fulfillment_id=2608403447971) |
| 9 | + self.assertEqual(1, len(fulfillment_event)) |
13 | 10 |
|
14 | 11 | def test_create_fulfillment_event(self):
|
15 |
| - pass |
| 12 | + self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='POST', body=self.load_fixture('fulfillment_event'), headers={'Content-type': 'application/json'}) |
| 13 | + new_fulfillment_event = shopify.FulfillmentEvent({'order_id': '2776493818019', 'fulfillment_id': '2608403447971'}) |
| 14 | + new_fulfillment_event.status = 'ready_for_pickup' |
| 15 | + new_fulfillment_event.save() |
16 | 16 |
|
17 | 17 | def test_error_on_incorrect_status(self):
|
18 | 18 | with self.assertRaises(AttributeError):
|
19 |
| - self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='PUT', body=self.load_fixture('article'), headers={'Content-type': 'application/json'}) |
20 |
| - self.fulfillment_event.save() |
| 19 | + self.fake("orders/2776493818019/fulfillments/2608403447971/events/12584341209251", method='GET', body=self.load_fixture('fulfillment_event')) |
| 20 | + incorrect_status = 'asdf' |
| 21 | + fulfillment_event = shopify.FulfillmentEvent.find(12584341209251, order_id='2776493818019', fulfillment_id='2608403447971') |
| 22 | + fulfillment_event.status = incorrect_status |
| 23 | + fulfillment_event.save() |
| 24 | + |
0 commit comments