File: test_persons.py

package info (click to toggle)
pychurchtools 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 408 kB
  • sloc: python: 2,060; makefile: 4
file content (54 lines) | stat: -rw-r--r-- 1,531 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from __future__ import annotations

from tests import get_ct_client


class TestPersons:
    @classmethod
    def setup_class(cls):
        cls.ct = get_ct_client()
        cls.me = cls.ct.general.whoami()

    def test_get(self):
        assert self.ct.persons.get(self.me.id)

    def test_list(self):
        assert self.ct.persons.get_all()

    # def test_tags(self):
    #    assert self.ct.persons.tags(self.me.id)

    # def test_relationships(self):
    #    assert self.ct.persons.relationships(self.me.id)

    def test_events(self):
        assert self.ct.persons.events(self.me.id)

    def test_groups(self):
        assert self.ct.persons.groups(self.me.id)

    def test_settings(self):
        settings = self.ct.persons.settings(self.me.id)
        assert settings
        assert self.ct.persons.setting(
            self.me.id, settings[0].module, settings[0].attribute
        )

    def test_birthdays(self):
        assert self.ct.persons.birthdays()

    def test_service_requests(self):
        servicerequests = self.ct.persons.servicerequests(self.me.id)
        assert servicerequests
        assert self.ct.persons.servicerequest(self.me.id, servicerequests[0].id)

    # def test_devices(self):
    #    devices = self.ct.persons.devices(self.me.id)
    #    assert devices
    #    assert self.ct.persons.device(self.me.id, devices[0].id)

    def test_logintoken(self):
        assert self.ct.persons.logintoken(self.me.id)

    def test_masterdata(self):
        assert self.ct.persons.masterdata()