Skip to content

Commit

Permalink
fix tests after short names
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamlahlou committed Feb 9, 2024
1 parent 9dd9792 commit 563e274
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions freppledb/odoo/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,19 @@ def test_odoo_e2e(self):
self.assertEqual(User.objects.get(username="admin").groups.all().count(), 1)

# Check input data
self.assertEqual(Item.objects.all().exclude(name__contains="[").count(), 7)
self.assertEqual(
Item.objects.all()
.exclude(name__startswith="D")
.exclude(name__startswith="E")
.exclude(name__startswith="F")
.count(),
7,
)
po_list = (
PurchaseOrder.objects.all()
.exclude(item__name__contains="[")
.exclude(item__name__startswith="D")
.exclude(item__name__startswith="E")
.exclude(item__name__startswith="F")
.filter(status="confirmed")
)
self.assertEqual(po_list.count(), 1)
Expand All @@ -125,7 +134,9 @@ def test_odoo_e2e(self):
# self.assertEqual(po.receipt_date, datetime.today() + timedelta)
self.assertEqual(
ManufacturingOrder.objects.all()
.exclude(item__name__contains="[")
.exclude(item__name__startswith="D")
.exclude(item__name__startswith="E")
.exclude(item__name__startswith="F")
.filter(status="confirmed")
.count(),
0, # TODO add draft and confirmed PO in demo dataset
Expand Down Expand Up @@ -158,14 +169,18 @@ def test_odoo_e2e(self):
# Check plan results
proposed_mo = (
ManufacturingOrder.objects.all()
.exclude(item__name__contains="[")
.exclude(item__name__startswith="D")
.exclude(item__name__startswith="E")
.exclude(item__name__startswith="F")
.filter(status="proposed", owner__isnull=True)
.order_by("startdate", "operation")
.first()
)
proposed_po = (
PurchaseOrder.objects.all()
.exclude(item__name__contains="[")
.exclude(item__name__startswith="D")
.exclude(item__name__startswith="E")
.exclude(item__name__startswith="F")
.filter(status="proposed")
.order_by("startdate", "supplier", "item")
.first()
Expand Down

0 comments on commit 563e274

Please sign in to comment.