Skip to content

Commit

Permalink
#883 Fix catalog_update command (#885)
Browse files Browse the repository at this point in the history
* #883  Test if product price is presented correctly

* #883  Fix update_catalog semantic error
  • Loading branch information
duker33 authored Jun 21, 2019
1 parent 933b79b commit 997c7a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def update_prices(packs: TagQuerySet):
packs.products().update(**fields_to_update)


def main(*args, kwargs):
def main(*args, **kwargs):
uuid = 'ae30f766-0bb8-11e6-80ea-02d2cc20e118'
pack_group = TagGroup.objects.filter(uuid=uuid).first()
if not pack_group:
Expand Down
5 changes: 5 additions & 0 deletions shopelectro/tests/tests_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,8 @@ def test_utm_yandex(self):
url = offer.find('url').text
get_attrs = urllib.parse.parse_qs(url)
self.assertEqual('cpc-market', get_attrs['utm_medium'][0])

def test_price_value(self):
offer = self.prices['YM'].offers_node[0]
product = Product.objects.get(vendor_code=offer.attrib['id'])
self.assertEqual(product.price, float(offer.find('price').text))

0 comments on commit 997c7a0

Please sign in to comment.