Ejemplo n.º 1
0
 def test_select_method(self):
     '''
     Test the BaseShippingStep managment form when method is set to 'select'
     and user isn't authenticated.
     '''
     self.request.POST = SELECT_ADDRESS_POST
     step = BaseShippingStep(self.checkout, self.request, self.address)
     self.assertFalse(step.forms_are_valid(), 'Forms should not validate.')
Ejemplo n.º 2
0
 def test_select_method(self):
     '''
     Test the BaseShippingStep managment form when method is set to 'select'
     and user isn't authenticated.
     '''
     self.request.POST = SELECT_ADDRESS_POST
     step = BaseShippingStep(self.checkout, self.request, self.address)
     self.assertFalse(step.forms_are_valid(), 'Forms should not validate.')
Ejemplo n.º 3
0
 def test_new_method(self):
     '''
     Test the BaseShippingStep managment form when method is set to 'new'
     and user isn't authenticated.
     '''
     self.request.POST = NEW_ADDRESS_POST
     step = BaseShippingStep(self.checkout, self.request, self.address)
     self.assertTrue(step.forms_are_valid(), 'Forms don\'t validate.')
     self.assertEqual(step.address.first_name, 'Test')
Ejemplo n.º 4
0
 def test_new_method(self):
     '''
     Test the BaseShippingStep managment form when method is set to 'new'
     and user isn't authenticated.
     '''
     self.request.POST = NEW_ADDRESS_POST
     step = BaseShippingStep(self.checkout, self.request, self.address)
     self.assertTrue(step.forms_are_valid(), 'Forms don\'t validate.')
     self.assertEqual(step.address.first_name, 'Test')
Ejemplo n.º 5
0
 def test_select_with_user_method(self):
     '''
     Test the BaseShippingStep managment form when method is set to 'select'
     and user is authenticated.
     '''
     user = self.request.user
     self.request.POST = SELECT_ADDRESS_POST
     user.is_authenticated.return_value = True
     user.address_book.all.__iter__.return_value = [self.address]
     step = BaseShippingStep(self.checkout, self.request, self.address)
     self.assertTrue(step.forms_are_valid(), 'Forms don\'t validate.')
Ejemplo n.º 6
0
 def test_select_with_user_method(self):
     '''
     Test the BaseShippingStep managment form when method is set to 'select'
     and user is authenticated.
     '''
     user = self.request.user
     self.request.POST = SELECT_ADDRESS_POST
     user.is_authenticated.return_value = True
     user.address_book.all.__iter__.return_value = [self.address]
     step = BaseShippingStep(self.checkout, self.request, self.address)
     self.assertTrue(step.forms_are_valid(), 'Forms don\'t validate.')