def test_create_order(self): BasketItemFactory(basket_id=self.basket_id), BasketItemFactory(basket_id=self.basket_id) order = create_order(self.email, self.request, self.addresses) self.assertIsNotNone(order) self.assertEqual(self.email, order.email) self.assertEqual(order.items.count(), 2)