示例#1
0
 def setUp(self):
     # Every test needs a client
     cache_delete()
     self.client = Client()
     self.US = Country.objects.get(iso2_code__iexact="US")
     current_site = Site.objects.get_current()
     cache_key = "cat-%s-%s" % (current_site.id, get_language())
     cache.delete(cache_key)
     rebuild_pricing()
示例#2
0
文件: tests.py 项目: twidi/satchmo
 def setUp(self):
     # Every test needs a client
     cache_delete()
     self.client = Client()
     self.US = Country.objects.get(iso2_code__iexact = "US")
     rebuild_pricing()
     current_site = Site.objects.get_current()
     cache_key = "cat-%s-%s" % (current_site.id, get_language())
     cache.delete(cache_key)
示例#3
0
文件: tests.py 项目: 34/T
 def setUp(self):
     self.client = Client()
     user = User.objects.create_user('wisher', '*****@*****.**', 'passwd')
     user.is_staff = False
     user.is_superuser = False
     user.save()
     self.contact = Contact.objects.create(user=user, first_name="Wish",
         last_name="Tester")
     self.client.login(username='******', password='******')
     rebuild_pricing()
示例#4
0
 def setUp(self):
     self.client = Client()
     user = User.objects.create_user('wisher', '*****@*****.**',
                                     'passwd')
     user.is_staff = False
     user.is_superuser = False
     user.save()
     self.contact = Contact.objects.create(user=user,
                                           first_name="Wish",
                                           last_name="Tester")
     self.client.login(username='******', password='******')
     rebuild_pricing()
示例#5
0
    def setUp(self):
        self.US = Country.objects.get(iso2_code__iexact='US')
        self.site = Site.objects.get_current()
        tax = config_get('TAX', 'MODULE')
        tax.update('tax.modules.no')
        c = Contact(first_name="Jim",
                    last_name="Tester",
                    role=ContactRole.objects.get(pk='Customer'),
                    email="*****@*****.**")
        c.save()
        ad = AddressBook(contact=c,
                         description="home",
                         street1="test",
                         state="OR",
                         city="Portland",
                         country=self.US,
                         is_default_shipping=True,
                         is_default_billing=True)
        ad.save()
        o = Order(contact=c, shipping_cost=Decimal('6.00'), site=self.site)
        o.save()
        small = Order(contact=c, shipping_cost=Decimal('6.00'), site=self.site)
        small.save()

        p = Product.objects.get(slug='neat-book-soft')
        price = p.unit_price
        item1 = OrderItem(order=o,
                          product=p,
                          quantity='1',
                          unit_price=price,
                          line_item_price=price)
        item1.save()

        item1s = OrderItem(order=small,
                           product=p,
                           quantity='1',
                           unit_price=price,
                           line_item_price=price)
        item1s.save()

        p = Product.objects.get(slug='neat-book-hard')
        price = p.unit_price
        item2 = OrderItem(order=o,
                          product=p,
                          quantity='1',
                          unit_price=price,
                          line_item_price=price)
        item2.save()
        self.order = o
        self.small = small

        rebuild_pricing()
示例#6
0
文件: tests.py 项目: hnejadi/EShop-2
    def setUp(self):
        self.US = Country.objects.get(iso2_code__iexact="US")
        self.site = Site.objects.get_current()
        tax = config_get("TAX", "MODULE")
        tax.update("tax.modules.no")
        c = Contact(
            first_name="Jim", last_name="Tester", role=ContactRole.objects.get(pk="Customer"), email="*****@*****.**"
        )
        c.save()
        ad = AddressBook(
            contact=c,
            description="home",
            street1="test",
            state="OR",
            city="Portland",
            country=self.US,
            is_default_shipping=True,
            is_default_billing=True,
        )
        ad.save()
        o = Order(contact=c, shipping_cost=Decimal("6.00"), site=self.site)
        o.save()
        small = Order(contact=c, shipping_cost=Decimal("6.00"), site=self.site)
        small.save()

        p = Product.objects.get(slug="neat-book-soft")
        price = p.unit_price
        item1 = OrderItem(order=o, product=p, quantity="1", unit_price=price, line_item_price=price)
        item1.save()

        item1s = OrderItem(order=small, product=p, quantity="1", unit_price=price, line_item_price=price)
        item1s.save()

        p = Product.objects.get(slug="neat-book-hard")
        price = p.unit_price
        item2 = OrderItem(order=o, product=p, quantity="1", unit_price=price, line_item_price=price)
        item2.save()
        self.order = o
        self.small = small

        rebuild_pricing()
示例#7
0
 def setUp(self):
     # Every test needs a client
     self.client = Client()
     rebuild_pricing()
示例#8
0
文件: tests.py 项目: twidi/satchmo
 def tearDown(self):
     cache_delete()
     rebuild_pricing()
示例#9
0
 def tearDown(self):
     cache_delete()
     rebuild_pricing()
示例#10
0
文件: tests.py 项目: hnejadi/xerobis
 def setUp(self):
     # Every test needs a client
     cache_delete()
     self.client = Client()
     self.US = Country.objects.get(iso2_code__iexact="US")
     rebuild_pricing()
示例#11
0
 def setUp(self):
     # Every test needs a client
     cache_delete()
     self.client = Client()
     self.US = Country.objects.get(iso2_code__iexact = "US")
     rebuild_pricing()
示例#12
0
文件: tests.py 项目: 34/T
 def setUp(self):
     # Every test needs a client
     self.client = Client()
     rebuild_pricing()