2017-06-13 21:44:45 +02:00
|
|
|
from unittest import TestCase
|
|
|
|
|
2018-08-22 07:59:22 +02:00
|
|
|
from openslides.users.access_permissions import PersonalNoteAccessPermissions
|
2017-06-13 21:44:45 +02:00
|
|
|
from openslides.utils.collection import CollectionElement
|
|
|
|
|
|
|
|
|
2017-08-31 21:12:39 +02:00
|
|
|
class TestPersonalNoteAccessPermissions(TestCase):
|
|
|
|
def test_get_restricted_data(self):
|
|
|
|
ap = PersonalNoteAccessPermissions()
|
|
|
|
rd = ap.get_restricted_data(
|
2017-09-04 00:25:45 +02:00
|
|
|
[{'user_id': 1}],
|
2017-08-31 21:12:39 +02:00
|
|
|
CollectionElement.from_values('users/user', 5, full_data={}))
|
2017-09-04 00:25:45 +02:00
|
|
|
self.assertEqual(rd, [])
|
2017-08-31 21:12:39 +02:00
|
|
|
|
|
|
|
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}],
|
2017-08-31 21:12:39 +02:00
|
|
|
None)
|
2017-09-04 00:25:45 +02:00
|
|
|
self.assertEqual(rd, [])
|