Ejemplo n.º 1
0
 def test_only_shipping_addresses_are_shown(self):
     not_shipping_country = factories.CountryFactory(
         iso_3166_1_a2='US', name="UNITED STATES",
         is_shipping_country=False)
     not_shipping_address = factories.UserAddressFactory(
         user=self.user, country=not_shipping_country, line4='New York')
     self.add_product_to_basket()
     page = self.get(reverse('checkout:shipping-address'))
     page.mustcontain(
         self.user_address.line4, self.user_address.country.name,
         no=[not_shipping_address.country.name, not_shipping_address.line4])
Ejemplo n.º 2
0
 def test_has_summary_property(self):
     c = factories.CountryFactory(name='')
     a = factories.UserAddressFactory(country=c,
                                      title='Dr',
                                      first_name='Barry',
                                      last_name='Barrington',
                                      line1='1 King Road',
                                      line4='London',
                                      postcode='SW1 9RE')
     self.assertEqual(
         "Dr Barry Barrington, 1 King Road, London, SW1 9RE, UNITED KINGDOM",
         a.summary)
Ejemplo n.º 3
0
 def setUp(self):
     country = self.create_shipping_country()
     super(TestUserAddressUpdateView, self).setUp()
     self.user_address = factories.UserAddressFactory(
         user=self.user, country=country)
Ejemplo n.º 4
0
 def setUp(self):
     super(TestDeleteUserAddressView, self).setUp()
     self.country = self.create_shipping_country()
     self.user_address = factories.UserAddressFactory(
         user=self.user, country=self.country)
Ejemplo n.º 5
0
 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)