OpenSlides/tests/unit/users/test_access_permissions.py

21 lines
697 B
Python
Raw Normal View History

from unittest import TestCase
2018-08-22 07:59:22 +02:00
from openslides.users.access_permissions import PersonalNoteAccessPermissions
from openslides.utils.collection import CollectionElement
class TestPersonalNoteAccessPermissions(TestCase):
def test_get_restricted_data(self):
ap = PersonalNoteAccessPermissions()
rd = ap.get_restricted_data(
[{'user_id': 1}],
CollectionElement.from_values('users/user', 5, full_data={}))
self.assertEqual(rd, [])
def test_get_restricted_data_for_anonymous(self):
ap = PersonalNoteAccessPermissions()
rd = ap.get_restricted_data(
2018-08-22 07:59:22 +02:00
[{'user_id': 1}],
None)
self.assertEqual(rd, [])