From 90c8b199159375a76580844e6eff8fbd868e9068 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Sun, 23 Oct 2016 12:45:27 +0100 Subject: [PATCH] Added tests for PO non-duplication --- RIGS/test_functional.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RIGS/test_functional.py b/RIGS/test_functional.py index 7e5010f7..673dadd1 100644 --- a/RIGS/test_functional.py +++ b/RIGS/test_functional.py @@ -438,7 +438,7 @@ class EventTest(LiveServerTestCase): pass def testEventDuplicate(self): - testEvent = models.Event.objects.create(name="TE E1", status=models.Event.PROVISIONAL, start_date=date.today() + timedelta(days=6), description="start future no end") + testEvent = models.Event.objects.create(name="TE E1", status=models.Event.PROVISIONAL, start_date=date.today() + timedelta(days=6), description="start future no end", purchase_order="TESTPO") item1 = models.EventItem( event=testEvent, @@ -498,6 +498,8 @@ class EventTest(LiveServerTestCase): infoPanel = self.browser.find_element_by_xpath('//div[contains(text(), "Event Info")]/..') self.assertIn("N0000%d"%testEvent.pk, infoPanel.find_element_by_xpath('//dt[text()="Based On"]/following-sibling::dd[1]').text) + # Check the PO hasn't carried through + self.assertNotIn("TESTPO", infoPanel.find_element_by_xpath('//dt[text()="PO"]/following-sibling::dd[1]').text) @@ -506,6 +508,8 @@ class EventTest(LiveServerTestCase): #Check that based-on hasn't crept into the old event infoPanel = self.browser.find_element_by_xpath('//div[contains(text(), "Event Info")]/..') self.assertNotIn("N0000%d"%testEvent.pk, infoPanel.find_element_by_xpath('//dt[text()="Based On"]/following-sibling::dd[1]').text) + # Check the PO remains on the old event + self.assertIn("TESTPO", infoPanel.find_element_by_xpath('//dt[text()="PO"]/following-sibling::dd[1]').text) # Check the items are as they were table = self.browser.find_element_by_id('item-table') # ID number is known, see above