def test_default_shipping_address(self): user_address = factories.UserAddressFactory( country=self.country, user=self.user, is_default_for_shipping=True ) request = RequestFactory().get(self.url, user=self.user) view = views.BasketView(request=request) self.assertEquals(view.get_default_shipping_address(), user_address)
def test_default_shipping_address_for_anonymous_user(self): request = RequestFactory().get(self.url) view = views.BasketView(request=request) self.assertIsNone(view.get_default_shipping_address())