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()
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)
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()
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()
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()
def setUp(self): # Every test needs a client self.client = Client() rebuild_pricing()
def tearDown(self): cache_delete() rebuild_pricing()
def setUp(self): # Every test needs a client cache_delete() self.client = Client() self.US = Country.objects.get(iso2_code__iexact="US") rebuild_pricing()
def setUp(self): # Every test needs a client cache_delete() self.client = Client() self.US = Country.objects.get(iso2_code__iexact = "US") rebuild_pricing()