示例#1
0
 def setUp(self):
     self.store = Store(clerk)
     try:
         try:
             state = clerk.match(State, CD="CA")[0]
         except:
             state = State(CD="CA")
         state.salestax = FixedPoint("8.25")
         clerk.store(state)
     except:
         pass
示例#2
0
 def setUp(self):
     self.store = Store(clerk)
     try:
         try:
             state = clerk.match(State, CD="CA")[0]
         except:
             state = State(CD="CA")
         state.salestax = FixedPoint("8.25")
         clerk.store(state)
     except:
         pass
示例#3
0
    def check_salesTax(self):

        addr = Contact()
        addr.stateCD = 'NY'
        addr.postal = '123456'

        actual = self.store.calcSalesTax(addr, 10)
        assert actual == 0, \
               "shouldn't have sales tax because no nexus in NY"

        addr = Contact()
        addr.stateCD = 'CA'

        actual = self.store.calcSalesTax(addr, 10)
        goal = (FixedPoint(clerk.match(State, CD="CA")[0].salestax) *
                10) / 100.0
        assert actual == goal, \
               "wrong sales tax after nexus established: %s vs %s" \
               % (actual, goal)
示例#4
0
    def check_salesTax(self):

        addr = Contact()
        addr.stateCD = 'NY'
        addr.postal = '123456'

        actual = self.store.calcSalesTax(addr, 10)
        assert actual == 0, \
               "shouldn't have sales tax because no nexus in NY"

        addr = Contact()
        addr.stateCD = 'CA'

        actual = self.store.calcSalesTax(addr, 10)
        goal = (FixedPoint(clerk.match(State, CD="CA")[0].salestax)
                * 10) / 100.0
        assert actual == goal, \
               "wrong sales tax after nexus established: %s vs %s" \
               % (actual, goal)