예제 #1
0
 def test_loading_classes_defined_in_both_local_and_oscar_modules(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (Free, FixedPrice) = get_classes('shipping.methods',
                                          ('Free', 'FixedPrice'))
         self.assertEqual('tests.shipping.methods', Free.__module__)
         self.assertEqual('oscar.apps.shipping.methods',
                          FixedPrice.__module__)
예제 #2
0
 def test_default_line_status_comes_from_settings(self):
     self.basket.add_product(create_product(price=D('12.00')))
     with patch_settings(OSCAR_INITIAL_LINE_STATUS='A'):
         self.creator.place_order(basket=self.basket, order_number='1234')
     order = Order.objects.get(number='1234')
     line = order.lines.all()[0]
     self.assertEqual('A', line.status)
예제 #3
0
 def test_default_line_status_comes_from_settings(self):
     self.basket.add_product(create_product(price=D('12.00')))
     with patch_settings(OSCAR_INITIAL_LINE_STATUS='A'):
         self.creator.place_order(basket=self.basket, order_number='1234')
     order = Order.objects.get(number='1234')
     line = order.lines.all()[0]
     self.assertEqual('A', line.status)
예제 #4
0
 def test_email_address_is_saved_with_order(self):
     with patch_settings(OSCAR_ALLOW_ANON_CHECKOUT=True):
         self.reload_urlconf()
         self.add_product_to_basket()
         self.complete_guest_email_form('*****@*****.**')
         self.complete_shipping_address()
         self.complete_shipping_method()
         response = self.client.post(reverse('checkout:payment-details'))
         response = self.client.get(reverse('checkout:thank-you'))
         order = response.context['order']
         self.assertEqual('*****@*****.**', order.guest_email)
예제 #5
0
 def test_email_address_is_saved_with_order(self):
     with patch_settings(OSCAR_ALLOW_ANON_CHECKOUT=True):
         self.reload_urlconf()
         self.add_product_to_basket()
         self.complete_guest_email_form('*****@*****.**')
         self.complete_shipping_address()
         self.complete_shipping_method()
         response = self.client.post(reverse('checkout:preview'),
                                     {'action': 'place_order'})
         response = self.client.get(reverse('checkout:thank-you'))
         order = response.context['order']
         self.assertEqual('*****@*****.**', order.guest_email)
예제 #6
0
 def test_loading_classes_defined_in_both_local_and_oscar_modules(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (Free, FixedPrice) = get_classes('shipping.methods', ('Free', 'FixedPrice'))
         self.assertEqual('tests.site.shipping.methods', Free.__module__)
         self.assertEqual('oscar.apps.shipping.methods', FixedPrice.__module__)
예제 #7
0
 def test_loading_class_from_module_not_defined_in_local_app(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (Repository,) = get_classes('shipping.repository', ('Repository',))
         self.assertEqual('oscar.apps.shipping.repository', Repository.__module__)
예제 #8
0
 def test_loading_class_which_is_not_defined_in_local_module(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (FixedPrice,) = get_classes('shipping.methods', ('FixedPrice',))
         self.assertEqual('oscar.apps.shipping.methods', FixedPrice.__module__)
예제 #9
0
 def test_loading_class_defined_in_local_module(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (Free,) = get_classes('shipping.methods', ('Free',))
         self.assertEqual('tests.site.shipping.methods', Free.__module__)
예제 #10
0
 def test_shipping_address_does_require_session_email_address(self):
     with patch_settings(OSCAR_ALLOW_ANON_CHECKOUT=True):
         self.reload_urlconf()
         url = reverse('checkout:shipping-address')
         response = self.client.get(url)
         self.assertIsRedirect(response)
예제 #11
0
 def test_loading_class_from_module_not_defined_in_local_app(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (Repository, ) = get_classes('shipping.repository',
                                      ('Repository', ))
         self.assertEqual('oscar.apps.shipping.repository',
                          Repository.__module__)
예제 #12
0
 def test_loading_class_which_is_not_defined_in_local_module(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (FixedPrice, ) = get_classes('shipping.methods', ('FixedPrice', ))
         self.assertEqual('oscar.apps.shipping.methods',
                          FixedPrice.__module__)
예제 #13
0
 def test_loading_class_defined_in_local_module(self):
     with patch_settings(INSTALLED_APPS=self.installed_apps):
         (Free, ) = get_classes('shipping.methods', ('Free', ))
         self.assertEqual('tests.shipping.methods', Free.__module__)
예제 #14
0
 def test_shipping_address_does_require_session_email_address(self):
     with patch_settings(OSCAR_ALLOW_ANON_CHECKOUT=True):
         self.reload_urlconf()
         url = reverse('checkout:shipping-address')
         response = self.client.get(url)
         self.assertIsRedirect(response)
예제 #15
0
 def test_uses_default_order_status_from_settings(self):
     self.basket.add_product(create_product(price=D('12.00')))
     with patch_settings(OSCAR_INITIAL_ORDER_STATUS='A'):
         self.creator.place_order(basket=self.basket, order_number='1234')
     order = Order.objects.get(number='1234')
     self.assertEqual('A', order.status)
예제 #16
0
 def test_default_order_status_comes_from_settings(self):
     self.basket.add_product(create_product(price=D("12.00")))
     with patch_settings(OSCAR_INITIAL_ORDER_STATUS="A"):
         self.creator.place_order(basket=self.basket, order_number="1234")
     order = Order.objects.get(number="1234")
     self.assertEqual("A", order.status)