Example #1
0
 def test_viewable_by__public_unpublished__owner(self):
     event = EventFactory(is_published=False, privacy=Event.PUBLIC)
     person = PersonFactory()
     OrganizationMember.objects.create(
         person=person,
         organization=event.organization,
         role=OrganizationMember.OWNER,
     )
     self.assertTrue(event.viewable_by(person))
Example #2
0
 def test_viewable_by__invited_published__invited(self):
     event = EventFactory(is_published=True, privacy=Event.INVITED)
     person = PersonFactory()
     OrderFactory(event=event, person=person)
     self.assertTrue(event.viewable_by(person))
Example #3
0
 def test_viewable_by__invited_published__anon(self):
     event = EventFactory(is_published=True, privacy=Event.INVITED)
     person = AnonymousUser()
     self.assertFalse(event.viewable_by(person))
Example #4
0
 def test_viewable_by__public_unpublished__authed(self):
     event = EventFactory(is_published=False, privacy=Event.PUBLIC)
     person = PersonFactory()
     self.assertFalse(event.viewable_by(person))
Example #5
0
 def test_viewable_by__public_unpublished__anon(self):
     event = EventFactory(is_published=False, privacy=Event.PUBLIC)
     person = AnonymousUser()
     self.assertFalse(event.viewable_by(person))