Event properties internal/authorised always return a explicit boolean rather than sometimes None

This commit is contained in:
2020-09-01 15:02:16 +01:00
parent 1d5429052f
commit 87e831a468
8 changed files with 50 additions and 47 deletions

View File

@@ -393,7 +393,7 @@ class TestEventDuplicate(BaseRigboardTest):
self.assertEqual(newEvent.auth_request_by, None)
self.assertEqual(newEvent.auth_request_at, None)
self.assertFalse(hasattr(newEvent, 'authorised'))
self.assertFalse(newEvent.authorised)
self.assertNotIn("N%05d" % self.testEvent.pk, self.driver.find_element_by_xpath('//h1').text)
self.assertNotIn("Event data duplicated but not yet saved", self.page.warning) # Check info message not visible

View File

@@ -101,8 +101,8 @@ class EventTestCase(TestCase):
self.assertEqual(models.Event.objects.count(), 18, "Incorrect number of events, check setup")
def test_rig_count(self):
# by my count this is 7
self.assertEqual(models.Event.objects.rig_count(), 8)
# Changed to not include unreturned dry hires in rig count
self.assertEqual(models.Event.objects.rig_count(), 7)
def test_current_events(self):
current_events = models.Event.objects.current_events()
@@ -374,8 +374,8 @@ class EventAuthorisationTestCase(TestCase):
is_superuser=True # lazily grant all permissions
)[0]
self.person = models.Person.objects.create(name='Authorisation Test Person')
self.organisation = models.Organisation.objects.create(name='Authorisation Test Organisation')
self.event = models.Event.objects.create(name="AuthorisationTestCase", person=self.person,
self.organisation = models.Organisation.objects.create(name='Authorisation Test Organisation', union_account=True)
self.event = models.Event.objects.create(name="AuthorisationTestCase", person=self.person, organisation=self.organisation,
start_date=date.today())
# Add some items
models.EventItem.objects.create(event=self.event, name="Authorisation test item", quantity=2, cost=123.45,