コード例 #1
0
ファイル: test_event_model.py プロジェクト: kahihia/django
 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))
コード例 #2
0
ファイル: test_event_model.py プロジェクト: kahihia/django
 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))
コード例 #3
0
ファイル: test_event_model.py プロジェクト: kahihia/django
 def test_viewable_by__invited_published__anon(self):
     event = EventFactory(is_published=True, privacy=Event.INVITED)
     person = AnonymousUser()
     self.assertFalse(event.viewable_by(person))
コード例 #4
0
ファイル: test_event_model.py プロジェクト: kahihia/django
 def test_viewable_by__public_unpublished__authed(self):
     event = EventFactory(is_published=False, privacy=Event.PUBLIC)
     person = PersonFactory()
     self.assertFalse(event.viewable_by(person))
コード例 #5
0
ファイル: test_event_model.py プロジェクト: kahihia/django
 def test_viewable_by__public_unpublished__anon(self):
     event = EventFactory(is_published=False, privacy=Event.PUBLIC)
     person = AnonymousUser()
     self.assertFalse(event.viewable_by(person))