當前位置: 首頁>>代碼示例>>Python>>正文


Python Wares.setstandardprice方法代碼示例

本文整理匯總了Python中polls.models.Wares.setstandardprice方法的典型用法代碼示例。如果您正苦於以下問題:Python Wares.setstandardprice方法的具體用法?Python Wares.setstandardprice怎麽用?Python Wares.setstandardprice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在polls.models.Wares的用法示例。


在下文中一共展示了Wares.setstandardprice方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_Waresdeletehistory

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
 def test_Waresdeletehistory(self):
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 0, True)
     Wares.insert("Carlsberg")
     try:
         Wares.insert("Carlsberg")
     except Alreadymade:
         pass        
     Wares.insert("Carlsberg Light")
     Wares.insert("Yankeebar")
     Wares.insert("Haribo Clickmix")
     Wares.insert("Mokai")
     Wares.insert("Heineken")
     Wares.insert("Tuborg")
     Wares.deletethis(1)
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.setwarename(2, "Carlsberg xtreme")
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.getthis(2)
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.getopeningwares()
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.getstdprice(2)
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.setwareinbar(2,10)
     Wares.setwareinbar(2,20)
     Wares.setwareinbar(3,11)
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.setwareinstockroom(3,300)
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.setstandardprice(2,1)
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 1, True)
     Wares.deletethis(5)
     self.assertEqual(len(Waresdeletehistory.objects.all()) == 2, True)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:35,代碼來源:tests.py

示例2: test_Waresnamehistory1

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
 def test_Waresnamehistory1(self):
     self.assertEqual(len(Waresnamehistory.objects.all().filter(warename="Carlsberg")) == 0, True)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 0, True)
     Wares.insert("Carlsberg")
     try:
         Wares.insert("Carlsberg")
     except Alreadymade:
         pass        
     Wares.insert("Carlsberg Light")
     Wares.insert("Yankeebar")
     Wares.insert("Haribo Clickmix")
     Wares.insert("Mokai")
     Wares.insert("Heineken")
     Wares.insert("Tuborg")
     self.assertEqual(len(Waresnamehistory.objects.all().filter(warename="Carlsberg")) == 1, True)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 7, True)
     Wares.setwarename(1, "Carlsberg xtreme")
     Wares.setwarename(7, "Tuborg guld")
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
     Wares.getthis(1)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
     Wares.getopeningwares()
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
     Wares.getstdprice(1)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
     Wares.setwareinbar(1,10)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
     Wares.setwareinstockroom(2,300)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
     Wares.setstandardprice(1,1)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
     Wares.deletethis(1)
     self.assertEqual(len(Waresnamehistory.objects.all()) == 9, True)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:35,代碼來源:tests.py

示例3: clean_price

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
 def clean_price(self):
     price = self.cleaned_data['price']
     if (price == None):
         pass
     else:
         Ourwares = Waresingroup.getwares(self.wgid)
         for warerelation in Ourwares:
             Wares.setstandardprice(warerelation.ware.id, price)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:10,代碼來源:forms.py

示例4: test_getstdprice

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
 def test_getstdprice(self): 
     Wares.insert("Carslberg")
     Wares.insert("Tuborg")
     Wares.setwareinbar(1,5)
     Wares.setwareinbar(2,10)
     self.assertEqual(len(Wares.objects.all().filter(inbar=5)) == 1, True)
     self.assertEqual(len(Wares.objects.all().filter(inbar=10)) == 1, True)
     self.assertEqual(len(Wares.objects.all().filter(inbar=2)) == 2, False)
     Wares.setstandardprice(1,10)
     Wares.setstandardprice(2,30)
     self.assertEqual(Wares.getstdprice(1) == 10, True)
     self.assertEqual(Wares.getstdprice(1) == 30, False)
     self.assertEqual(Wares.getstdprice(2) == 30, True)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:15,代碼來源:tests.py

示例5: test_insertpricing

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
 def test_insertpricing(self):
     Wares.insert("Carlsberg")
     Wares.insert("Tuborg")
     Wares.setstandardprice(1,500) #Carlsberg er dyrt
     Wares.setstandardprice(2,50)
     Events.insert("Paaske")
     Events.insert("frebar")
     Events.insert("hverdag")
     
     Pricesinevent.insert(1,1)
     Pricesinevent.insert(1,2)
     Pricesinevent.insert(1,3)
     Pricesinevent.insert(2,1)
     Pricesinevent.insert(2,2)
     Pricesinevent.insert(2,3)
     self.assertEqual(len(Events.objects.all()) == 3, True)
     self.assertEqual(len(Pricesinevent.objects.all()) == 6, True)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:19,代碼來源:tests.py

示例6: test_geteventprice

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
    def test_geteventprice(self):
        Wares.insert("Carlsberg")
        Wares.insert("Tuborg")
        Wares.setstandardprice(1,500) #Carlsberg er dyrt
        Wares.setstandardprice(2,50)
        Events.insert("Paaske")
        Events.insert("frebar")
        Events.insert("hverdag")
        
        Pricesinevent.insert(1,1)
        Pricesinevent.insert(1,2)
        Pricesinevent.insert(1,3)
        Pricesinevent.insert(2,1)
        Pricesinevent.insert(2,2)
        Pricesinevent.insert(2,3)
        
        newprice = Pricesinevent.geteventprice(1,1)
        self.assertEqual(newprice==500, True)

        Pricesinevent.setprice(1,1,-50)
        
        newprice = Pricesinevent.geteventprice(1,1)
        self.assertEqual(newprice==500, False)
        self.assertEqual(newprice==450, True)
        
        Pricesinevent.setprice(1,1,-50)
        newprice = Pricesinevent.geteventprice(1,1)
        self.assertEqual(newprice==450, True)

        Pricesinevent.setprice(2,1,-50)
        newprice = Pricesinevent.geteventprice(2,1)
        self.assertEqual(newprice==0, True)

        Pricesinevent.setprice(2,1,-100)
        newprice = Pricesinevent.geteventprice(2,1)
        self.assertEqual(newprice==-50, True)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:38,代碼來源:tests.py

示例7: test_standardprice

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
 def test_standardprice(self):
     Wares.insert("Carslberg")
     Wares.insert("Tuborg")
     Wares.insert("Heineken")
     Wares.setwareinbar(1,5)
     Wares.setwareinstockroom(1,5)
     Wares.setstandardprice(1,500) #Carlsberg er dyrt
     Wares.setstandardprice(2,50)
     Wares.setstandardprice(3,50) 
     self.assertEqual(len(Wares.objects.all().filter(standardprice=500)) == 1, True)
     self.assertEqual(len(Wares.objects.all().filter(standardprice=50)) == 2, True)
     self.assertEqual(len(Wares.objects.all()) == 3, True)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:14,代碼來源:tests.py

示例8: test_getprice

# 需要導入模塊: from polls.models import Wares [as 別名]
# 或者: from polls.models.Wares import setstandardprice [as 別名]
 def test_getprice(self):
     Wares.insert("Carslberg")
     Wares.insert("Tuborg")
     Wares.insert("Heineken")
     Wares.setwareinbar(1,5)
     Wares.setwareinstockroom(1,5)
     Wares.setstandardprice(1,500) #Carlsberg er dyrt
     Wares.setstandardprice(2,50)
     Wares.setstandardprice(3,50) 
     self.assertEqual(len(Wares.objects.all().filter(standardprice=500)) == 1, True)
     self.assertEqual(len(Wares.objects.all().filter(standardprice=50)) == 2, True)
     self.assertEqual(len(Wares.objects.all()) == 3, True)
     Events.insert("Paaske")
     Events.insert("frebar")
     Events.insert("hverdag")
     Pricesinevent.insert(1,1)
     Pricesinevent.insert(1,2)
     Pricesinevent.insert(1,3)
     Pricesinevent.insert(2,1)
     Pricesinevent.insert(2,2)
     Pricesinevent.insert(2,3)
     Pricesinevent.setprice(1,1,-50)
     self.assertEqual(Extrafunctions.getprice(1,1) == 450, True)
開發者ID:cejsing,項目名稱:Softwareudvikling,代碼行數:25,代碼來源:tests.py


注:本文中的polls.models.Wares.setstandardprice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。