def test_order_remove_item_existing_twice(self):
        items_before = ep.orders_find(self.order1['order_id']).json()['items']
        res = ep.orders_remove_item(self.order1['order_id'],
                                    self.item1['item_id'])
        res2 = ep.orders_remove_item(self.order1['order_id'],
                                     self.item1['item_id'])
        items_after = ep.orders_find(self.order1['order_id']).json()['items']

        test = items_before.copy()
        test.remove(self.item1['item_id'])
        test.remove(self.item1['item_id'])

        self.assertTrue(res.ok)
        self.assertTrue(res2.ok)
        self.assertNotEqual(items_before, items_after)
        self.assertCountEqual(test, items_after)
    def test_order_remove_item_non_existing_item(self):
        items_before = ep.orders_find(self.order1['order_id']).json()['items']

        res = ep.orders_remove_item(self.order1['order_id'],
                                    self.user1['user_id'])

        items_after = ep.orders_find(self.order1['order_id']).json()['items']

        self.assertFalse(res.ok)
        self.assertEqual(items_before, items_after)
 def test_order_remove_item_non_existing_order(self):
     res = ep.orders_remove_item(self.user1['user_id'],
                                 self.item1['item_id'])
     self.assertFalse(res.ok)