コード例 #1
0
ファイル: testStore.py プロジェクト: souca/sixthdev
 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
ファイル: testStore.py プロジェクト: elmore/sixthdev
 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
ファイル: testStore.py プロジェクト: souca/sixthdev
    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
ファイル: testStore.py プロジェクト: elmore/sixthdev
    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)