本文整理匯總了Python中price_watch.models.Product.get_package_key方法的典型用法代碼示例。如果您正苦於以下問題:Python Product.get_package_key方法的具體用法?Python Product.get_package_key怎麽用?Python Product.get_package_key使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類price_watch.models.Product
的用法示例。
在下文中一共展示了Product.get_package_key方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_950g
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_950g(self):
product3 = Product(u'Молоко Веселый молочник 950г', category=self.milk)
product4 = Product(u'Молоко Веселый молочник 950 г',
category=self.milk)
self.assertEqual('0.95 kg', product3.get_package_key())
self.assertEqual('0.95 kg', product4.get_package_key())
self.assertFalse(product4.get_package().is_normal(self.milk))
self.assertEqual(0.93,
round(product4.get_package().get_ratio(self.milk), 2))
示例2: test_250g_comma_preceding
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_250g_comma_preceding(self):
sour_cream025 = Product(u'Сметана Углече Поле органическая 15%, 250г')
key = sour_cream025.get_category_key()
sour_cream = ProductCategory(key)
self.assertEqual('0.25 kg', sour_cream025.get_package_key())
self.assertEqual(0.625,
sour_cream025.get_package().get_ratio(sour_cream))
示例3: test_1l_dot_preceding
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_1l_dot_preceding(self):
product = Product(u'Молоко Пармалат 3.5% стерил.1л')
self.assertEqual('1 l', product.get_package_key())
示例4: test_500g_model_preceding
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_500g_model_preceding(self):
product = Product(u'Спагетти PASTA ZARA №4,500г')
self.assertEqual('0.5 kg', product.get_package_key())
示例5: test_5x100g
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_5x100g(self):
product = Product(u'Глазурь Др.Откер сахарн.вкус марципана 5х100г')
self.assertEqual('0.5 kg', product.get_package_key())
示例6: test_02kg_decimal_dot
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_02kg_decimal_dot(self):
product = Product(u'Сметана 15% 0.2кг стакан Пискаревский')
self.assertEqual('0.2 kg', product.get_package_key())
示例7: test_085l
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_085l(self):
product = Product(u'МОЛОКО 3,2% п/п 0,85л КИРЗА',)
self.assertEqual('0.85 l', product.get_package_key())
示例8: test_1_5kg
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_1_5kg(self):
category = ProductCategory('rice')
product = Product(u'Рис АГРОАЛЬЯНС краснодарский 1,5кг',
category=category)
self.assertEqual('1.5 kg', product.get_package_key())
示例9: test_1_3_1_5kg
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_1_3_1_5kg(self):
product = Product(u'Яблоки Ред Делишес (55+) 1,3-1,5кг')
self.assertEqual('1.4 kg', product.get_package_key())
示例10: test_4_5kg_dot_preceding
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_4_5kg_dot_preceding(self):
product = Product(u'Картофель Деревенский фасов.4.5кг Агроторг')
self.assertEqual('4.5 kg', product.get_package_key())
示例11: test_1l
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_1l(self):
product = Product(u'Молоко Веселый молочник 1л', category=self.milk)
self.assertEqual('1 l', product.get_package_key())
self.assertTrue(product.get_package().is_normal(self.milk))
self.assertEqual(1, product.get_package().get_ratio(self.milk))
示例12: test_1kg_12kg
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_1kg_12kg(self):
product = Product(u'Томаты сливка, 1,0-1,2кг')
self.assertEqual('1.1 kg', product.get_package_key())
示例13: test_045kg_model_preceding
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_045kg_model_preceding(self):
product = Product(u'Макароны ШЕБЕКИНСКИЕ, ракушка №393,450г')
self.assertEqual('0.45 kg', product.get_package_key())
示例14: test_04kg
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_04kg(self):
product = Product(u'Хлеб Мультисид Английск.диетич.нар.0.4кг Каравай')
self.assertEqual('0.4 kg', product.get_package_key())
示例15: test_05kg
# 需要導入模塊: from price_watch.models import Product [as 別名]
# 或者: from price_watch.models.Product import get_package_key [as 別名]
def test_05kg(self):
product = Product(u'Сахар рафинад МОН КАФЕ фигурный 0,5 кг')
self.assertEqual('0.5 kg', product.get_package_key())