Ejemplo n.º 1
0
 def setUp(self):
     self.user = create_user(id=42, username='******', password='******')
     profile = CustomerProfile(customer=self.user, profile_id='6666')
     profile.save(sync=False)
     self.payment_profile = CustomerPaymentProfile(
         customer=self.user,
         customer_profile=profile,
         payment_profile_id='7777',
     )
     self.payment_profile.save(sync=False)
     self.client.login(username='******', password='******')
Ejemplo n.º 2
0
 def setUp(self):
     self.user = create_user(id=42, username='******', password='******')
     profile = CustomerProfile(customer=self.user, profile_id='6666')
     profile.save(sync=False)
     self.payment_profile = CustomerPaymentProfile(
         customer=self.user,
         customer_profile=profile,
         payment_profile_id='7777',
     )
     self.payment_profile.save(sync=False)
     self.client.login(username='******', password='******')
Ejemplo n.º 3
0
 def test_create_sync_no_data(self):
     @cim_url_match
     def request_handler(url, request):
         request_xml = parseString(request.body)
         self.assertEqual(xml_to_dict(request_xml),
                          create_empty_profile_success)
         return customer_profile_success.format(
             'createCustomerProfileResponse')
     profile = CustomerProfile(customer=self.user)
     with HTTMock(error_on_request):
         self.assertRaises(RequestError, profile.save)
     self.assertEqual(profile.profile_id, '')
     with HTTMock(request_handler):
         profile.save(sync=True)
     self.assertEqual(profile.profile_id, '6666')
Ejemplo n.º 4
0
 def test_create_no_sync(self):
     profile = CustomerProfile(customer=self.user)
     profile.save(sync=False)
     self.assertEqual(profile.profile_id, '')