wbcrm 1.56.8__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wbcrm/__init__.py +1 -0
- wbcrm/admin/__init__.py +5 -0
- wbcrm/admin/accounts.py +60 -0
- wbcrm/admin/activities.py +104 -0
- wbcrm/admin/events.py +43 -0
- wbcrm/admin/groups.py +8 -0
- wbcrm/admin/products.py +9 -0
- wbcrm/apps.py +5 -0
- wbcrm/configurations/__init__.py +1 -0
- wbcrm/configurations/base.py +16 -0
- wbcrm/dynamic_preferences_registry.py +38 -0
- wbcrm/factories/__init__.py +14 -0
- wbcrm/factories/accounts.py +57 -0
- wbcrm/factories/activities.py +124 -0
- wbcrm/factories/groups.py +24 -0
- wbcrm/factories/products.py +11 -0
- wbcrm/filters/__init__.py +10 -0
- wbcrm/filters/accounts.py +80 -0
- wbcrm/filters/activities.py +204 -0
- wbcrm/filters/groups.py +21 -0
- wbcrm/filters/products.py +38 -0
- wbcrm/filters/signals.py +95 -0
- wbcrm/fixtures/wbcrm.json +1215 -0
- wbcrm/kpi_handlers/activities.py +171 -0
- wbcrm/locale/de/LC_MESSAGES/django.mo +0 -0
- wbcrm/locale/de/LC_MESSAGES/django.po +1557 -0
- wbcrm/locale/de/LC_MESSAGES/django.po.translated +1630 -0
- wbcrm/locale/en/LC_MESSAGES/django.mo +0 -0
- wbcrm/locale/en/LC_MESSAGES/django.po +1466 -0
- wbcrm/locale/fr/LC_MESSAGES/django.mo +0 -0
- wbcrm/locale/fr/LC_MESSAGES/django.po +1467 -0
- wbcrm/migrations/0001_initial_squashed_squashed_0032_productcompanyrelationship_alter_product_prospects_and_more.py +3948 -0
- wbcrm/migrations/0002_alter_activity_repeat_choice.py +32 -0
- wbcrm/migrations/0003_remove_activity_external_id_and_more.py +63 -0
- wbcrm/migrations/0004_alter_activity_status.py +28 -0
- wbcrm/migrations/0005_account_accountrole_accountroletype_and_more.py +182 -0
- wbcrm/migrations/0006_alter_activity_location.py +17 -0
- wbcrm/migrations/0007_alter_account_status.py +23 -0
- wbcrm/migrations/0008_alter_activity_options.py +16 -0
- wbcrm/migrations/0009_alter_account_is_public.py +19 -0
- wbcrm/migrations/0010_alter_account_reference_id.py +17 -0
- wbcrm/migrations/0011_activity_summary.py +22 -0
- wbcrm/migrations/0012_alter_activity_summary.py +17 -0
- wbcrm/migrations/0013_account_action_plan_account_relationship_status_and_more.py +34 -0
- wbcrm/migrations/0014_alter_account_relationship_status.py +24 -0
- wbcrm/migrations/0015_alter_activity_type.py +23 -0
- wbcrm/migrations/0016_auto_20241205_1015.py +106 -0
- wbcrm/migrations/0017_event.py +40 -0
- wbcrm/migrations/0018_activity_search_vector.py +24 -0
- wbcrm/migrations/__init__.py +0 -0
- wbcrm/models/__init__.py +5 -0
- wbcrm/models/accounts.py +648 -0
- wbcrm/models/activities.py +1419 -0
- wbcrm/models/events.py +15 -0
- wbcrm/models/groups.py +119 -0
- wbcrm/models/llm/activity_summaries.py +41 -0
- wbcrm/models/llm/analyze_relationship.py +50 -0
- wbcrm/models/products.py +86 -0
- wbcrm/models/recurrence.py +280 -0
- wbcrm/preferences.py +13 -0
- wbcrm/report/activity_report.py +110 -0
- wbcrm/serializers/__init__.py +23 -0
- wbcrm/serializers/accounts.py +141 -0
- wbcrm/serializers/activities.py +525 -0
- wbcrm/serializers/groups.py +30 -0
- wbcrm/serializers/products.py +58 -0
- wbcrm/serializers/recurrence.py +91 -0
- wbcrm/serializers/signals.py +71 -0
- wbcrm/static/wbcrm/markdown/documentation/activity.md +86 -0
- wbcrm/static/wbcrm/markdown/documentation/activitytype.md +20 -0
- wbcrm/static/wbcrm/markdown/documentation/group.md +2 -0
- wbcrm/static/wbcrm/markdown/documentation/product.md +11 -0
- wbcrm/synchronization/__init__.py +0 -0
- wbcrm/synchronization/activity/__init__.py +0 -0
- wbcrm/synchronization/activity/admin.py +73 -0
- wbcrm/synchronization/activity/backend.py +214 -0
- wbcrm/synchronization/activity/backends/__init__.py +0 -0
- wbcrm/synchronization/activity/backends/google/__init__.py +2 -0
- wbcrm/synchronization/activity/backends/google/google_calendar_backend.py +406 -0
- wbcrm/synchronization/activity/backends/google/request_utils/__init__.py +16 -0
- wbcrm/synchronization/activity/backends/google/request_utils/external_to_internal/create.py +75 -0
- wbcrm/synchronization/activity/backends/google/request_utils/external_to_internal/delete.py +78 -0
- wbcrm/synchronization/activity/backends/google/request_utils/external_to_internal/update.py +155 -0
- wbcrm/synchronization/activity/backends/google/request_utils/internal_to_external/update.py +181 -0
- wbcrm/synchronization/activity/backends/google/tasks.py +21 -0
- wbcrm/synchronization/activity/backends/google/tests/__init__.py +0 -0
- wbcrm/synchronization/activity/backends/google/tests/conftest.py +1 -0
- wbcrm/synchronization/activity/backends/google/tests/test_data.py +81 -0
- wbcrm/synchronization/activity/backends/google/tests/test_google_backend.py +319 -0
- wbcrm/synchronization/activity/backends/google/tests/test_utils.py +274 -0
- wbcrm/synchronization/activity/backends/google/typing_informations.py +139 -0
- wbcrm/synchronization/activity/backends/google/utils.py +217 -0
- wbcrm/synchronization/activity/backends/outlook/__init__.py +0 -0
- wbcrm/synchronization/activity/backends/outlook/backend.py +593 -0
- wbcrm/synchronization/activity/backends/outlook/msgraph.py +436 -0
- wbcrm/synchronization/activity/backends/outlook/parser.py +432 -0
- wbcrm/synchronization/activity/backends/outlook/tests/__init__.py +0 -0
- wbcrm/synchronization/activity/backends/outlook/tests/conftest.py +1 -0
- wbcrm/synchronization/activity/backends/outlook/tests/fixtures.py +606 -0
- wbcrm/synchronization/activity/backends/outlook/tests/test_admin.py +118 -0
- wbcrm/synchronization/activity/backends/outlook/tests/test_backend.py +274 -0
- wbcrm/synchronization/activity/backends/outlook/tests/test_controller.py +249 -0
- wbcrm/synchronization/activity/backends/outlook/tests/test_parser.py +174 -0
- wbcrm/synchronization/activity/controller.py +627 -0
- wbcrm/synchronization/activity/dynamic_preferences_registry.py +119 -0
- wbcrm/synchronization/activity/preferences.py +27 -0
- wbcrm/synchronization/activity/shortcuts.py +16 -0
- wbcrm/synchronization/activity/tasks.py +21 -0
- wbcrm/synchronization/activity/urls.py +7 -0
- wbcrm/synchronization/activity/utils.py +46 -0
- wbcrm/synchronization/activity/views.py +41 -0
- wbcrm/synchronization/admin.py +1 -0
- wbcrm/synchronization/apps.py +14 -0
- wbcrm/synchronization/dynamic_preferences_registry.py +1 -0
- wbcrm/synchronization/management.py +36 -0
- wbcrm/synchronization/tasks.py +1 -0
- wbcrm/synchronization/urls.py +5 -0
- wbcrm/tasks.py +264 -0
- wbcrm/templates/email/activity.html +98 -0
- wbcrm/templates/email/activity_report.html +6 -0
- wbcrm/templates/email/daily_summary.html +72 -0
- wbcrm/templates/email/global_daily_summary.html +85 -0
- wbcrm/tests/__init__.py +0 -0
- wbcrm/tests/accounts/__init__.py +0 -0
- wbcrm/tests/accounts/test_models.py +393 -0
- wbcrm/tests/accounts/test_viewsets.py +88 -0
- wbcrm/tests/conftest.py +76 -0
- wbcrm/tests/disable_signals.py +62 -0
- wbcrm/tests/e2e/__init__.py +1 -0
- wbcrm/tests/e2e/e2e_wbcrm_utility.py +83 -0
- wbcrm/tests/e2e/test_e2e.py +370 -0
- wbcrm/tests/test_assignee_methods.py +40 -0
- wbcrm/tests/test_chartviewsets.py +112 -0
- wbcrm/tests/test_dto.py +64 -0
- wbcrm/tests/test_filters.py +52 -0
- wbcrm/tests/test_models.py +217 -0
- wbcrm/tests/test_recurrence.py +292 -0
- wbcrm/tests/test_report.py +21 -0
- wbcrm/tests/test_serializers.py +171 -0
- wbcrm/tests/test_tasks.py +95 -0
- wbcrm/tests/test_viewsets.py +967 -0
- wbcrm/tests/tests.py +121 -0
- wbcrm/typings.py +109 -0
- wbcrm/urls.py +67 -0
- wbcrm/viewsets/__init__.py +22 -0
- wbcrm/viewsets/accounts.py +122 -0
- wbcrm/viewsets/activities.py +341 -0
- wbcrm/viewsets/buttons/__init__.py +7 -0
- wbcrm/viewsets/buttons/accounts.py +27 -0
- wbcrm/viewsets/buttons/activities.py +89 -0
- wbcrm/viewsets/buttons/signals.py +17 -0
- wbcrm/viewsets/display/__init__.py +12 -0
- wbcrm/viewsets/display/accounts.py +110 -0
- wbcrm/viewsets/display/activities.py +444 -0
- wbcrm/viewsets/display/groups.py +22 -0
- wbcrm/viewsets/display/products.py +105 -0
- wbcrm/viewsets/endpoints/__init__.py +8 -0
- wbcrm/viewsets/endpoints/accounts.py +25 -0
- wbcrm/viewsets/endpoints/activities.py +30 -0
- wbcrm/viewsets/endpoints/groups.py +7 -0
- wbcrm/viewsets/endpoints/products.py +9 -0
- wbcrm/viewsets/groups.py +38 -0
- wbcrm/viewsets/menu/__init__.py +8 -0
- wbcrm/viewsets/menu/accounts.py +18 -0
- wbcrm/viewsets/menu/activities.py +49 -0
- wbcrm/viewsets/menu/groups.py +16 -0
- wbcrm/viewsets/menu/products.py +20 -0
- wbcrm/viewsets/mixins.py +35 -0
- wbcrm/viewsets/previews/__init__.py +1 -0
- wbcrm/viewsets/previews/activities.py +10 -0
- wbcrm/viewsets/products.py +57 -0
- wbcrm/viewsets/recurrence.py +27 -0
- wbcrm/viewsets/titles/__init__.py +13 -0
- wbcrm/viewsets/titles/accounts.py +23 -0
- wbcrm/viewsets/titles/activities.py +61 -0
- wbcrm/viewsets/titles/products.py +13 -0
- wbcrm/viewsets/titles/utils.py +46 -0
- wbcrm/workflows/__init__.py +1 -0
- wbcrm/workflows/assignee_methods.py +25 -0
- wbcrm-1.56.8.dist-info/METADATA +11 -0
- wbcrm-1.56.8.dist-info/RECORD +182 -0
- wbcrm-1.56.8.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
import copy
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from django.contrib.messages import storage
|
|
5
|
+
from rest_framework.test import APIRequestFactory
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class MSGraphFixture:
|
|
9
|
+
token = None
|
|
10
|
+
_subscriptions = []
|
|
11
|
+
_subscription = None
|
|
12
|
+
tenant_id = None
|
|
13
|
+
event = None
|
|
14
|
+
event_by_uid = None
|
|
15
|
+
instances_event = []
|
|
16
|
+
extension_event = None
|
|
17
|
+
|
|
18
|
+
def _get_access_token(self):
|
|
19
|
+
return self.token
|
|
20
|
+
|
|
21
|
+
def applications(self):
|
|
22
|
+
return None
|
|
23
|
+
|
|
24
|
+
def subscriptions(self):
|
|
25
|
+
return self._subscriptions
|
|
26
|
+
|
|
27
|
+
def subscription(self, subscription_id: str):
|
|
28
|
+
return self._subscription
|
|
29
|
+
|
|
30
|
+
def _renew_subscription(self, subscription_id: str):
|
|
31
|
+
return self._subscription
|
|
32
|
+
|
|
33
|
+
def get_tenant_id(self, email: str):
|
|
34
|
+
return self.tenant_id
|
|
35
|
+
|
|
36
|
+
def _subscribe(self, resource: str, change_type: str):
|
|
37
|
+
return self._subscription
|
|
38
|
+
|
|
39
|
+
def _unsubscribe(self, subscription_id: str):
|
|
40
|
+
return None
|
|
41
|
+
|
|
42
|
+
def get_event_by_resource(self, resource: str):
|
|
43
|
+
return self.event
|
|
44
|
+
|
|
45
|
+
def get_event(self, tenant_id: str, external_id: str):
|
|
46
|
+
return self.event
|
|
47
|
+
|
|
48
|
+
def get_event_by_uid(self, tenant_id: str, uid: str):
|
|
49
|
+
return self.event_by_uid
|
|
50
|
+
|
|
51
|
+
def get_instances_event(self, tenant_id: str, external_id: str, start: str, end: str):
|
|
52
|
+
return self.instances_event
|
|
53
|
+
|
|
54
|
+
def get_extension_event(self, tenant_id: str, extension_id: str):
|
|
55
|
+
return self.extension_event
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@pytest.mark.django_db
|
|
59
|
+
class TestOutlookSyncFixture:
|
|
60
|
+
@pytest.fixture()
|
|
61
|
+
def fixture_request(self):
|
|
62
|
+
request = APIRequestFactory().get("")
|
|
63
|
+
request.session = {} # for sessions middleware
|
|
64
|
+
request._messages = storage.default_storage(request) # for messages middleware
|
|
65
|
+
return request
|
|
66
|
+
|
|
67
|
+
@pytest.fixture()
|
|
68
|
+
def credentials_fixture(self):
|
|
69
|
+
return '{"notification_url": "https://test.com/api/crm/sync/activity/event_watch", "authority": "https://test.com/fake_app_tenant_id", "client_id": "fake_client_id", "client_secret": "fake_client_secret", "token_endpoint": "/fake_token", "graph_url": "https://fake_url"}'
|
|
70
|
+
|
|
71
|
+
@pytest.fixture()
|
|
72
|
+
def notification_created_fixture(self):
|
|
73
|
+
return {
|
|
74
|
+
"subscription_id": "fake_subscription_id",
|
|
75
|
+
"subscription_expiration": "2022-12-11T09:05:13+00:00",
|
|
76
|
+
"change_type": "created",
|
|
77
|
+
"resource": "Users/fake_user_id/Events/fake_event_id",
|
|
78
|
+
"resource_data": {
|
|
79
|
+
"@odata.etag": "fake_etag",
|
|
80
|
+
"@odata.id": "Users/fake_user_id/Events/fake_event_id",
|
|
81
|
+
"@odata.type": "#Microsoft.Graph.Event",
|
|
82
|
+
"id": "unique_id",
|
|
83
|
+
},
|
|
84
|
+
"client_state": "secretClientValue",
|
|
85
|
+
"tenant_id": "fake_tenant_id",
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@pytest.fixture()
|
|
89
|
+
def notification_fixture(self, notification_created_fixture):
|
|
90
|
+
_fixture = copy.deepcopy(notification_created_fixture)
|
|
91
|
+
_fixture["change_type"] = "deleted"
|
|
92
|
+
return _fixture
|
|
93
|
+
|
|
94
|
+
@pytest.fixture()
|
|
95
|
+
def notification_call_record_fixture(self, notification_created_fixture):
|
|
96
|
+
notification_call_record_fixture = copy.deepcopy(notification_created_fixture)
|
|
97
|
+
notification_call_record_fixture["resource_data"]["@odata.type"] = "/communications/callRecords"
|
|
98
|
+
return notification_call_record_fixture
|
|
99
|
+
|
|
100
|
+
@pytest.fixture()
|
|
101
|
+
def organizer_event_fixture(self):
|
|
102
|
+
return {
|
|
103
|
+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('cd209b0b-3f83-4c35-82d2-d88a61820480')/events/$entity",
|
|
104
|
+
"@odata.etag": 'W/"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ=="',
|
|
105
|
+
"id": "AAMkAGI1AAAt9AHjAAA=",
|
|
106
|
+
"createdDateTime": "2017-04-15T03:00:50.7579581Z",
|
|
107
|
+
"lastModifiedDateTime": "2017-04-15T03:00:51.245372Z",
|
|
108
|
+
"changeKey": "ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==",
|
|
109
|
+
"categories": [],
|
|
110
|
+
"originalStartTimeZone": "Pacific Standard Time",
|
|
111
|
+
"originalEndTimeZone": "Pacific Standard Time",
|
|
112
|
+
"iCalUId": "040000008200E00074C5B7101A82E00800000000DA2B357D94B5D201000000000000000010000000EC4597557F0CB34EA4CC2887EA7B17C3",
|
|
113
|
+
"reminderMinutesBeforeStart": 15,
|
|
114
|
+
"isReminderOn": True,
|
|
115
|
+
"hasAttachments": False,
|
|
116
|
+
"hideAttendees": False,
|
|
117
|
+
"subject": "Let's go brunch",
|
|
118
|
+
"bodyPreview": "Does noon work for you?",
|
|
119
|
+
"importance": "normal",
|
|
120
|
+
"sensitivity": "normal",
|
|
121
|
+
"isAllDay": False,
|
|
122
|
+
"isCancelled": False,
|
|
123
|
+
"isDraft": False,
|
|
124
|
+
"isOrganizer": True,
|
|
125
|
+
"responseRequested": True,
|
|
126
|
+
"seriesMasterId": None,
|
|
127
|
+
"transactionId": "7E163156-7762-4BEB-A1C6-729EA81755A7",
|
|
128
|
+
"showAs": "busy",
|
|
129
|
+
"type": "singleInstance",
|
|
130
|
+
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkAGI1AAAt9AHjAAA%3D&exvsurl=1&path=/calendar/item",
|
|
131
|
+
"onlineMeetingUrl": None,
|
|
132
|
+
"isOnlineMeeting": True,
|
|
133
|
+
"onlineMeetingProvider": "unknown",
|
|
134
|
+
"onlineMeeting": None,
|
|
135
|
+
"allowNewTimeProposals": True,
|
|
136
|
+
"responseStatus": {"response": "organizer", "time": "0001-01-01T00:00:00Z"},
|
|
137
|
+
"body": {
|
|
138
|
+
"contentType": "html",
|
|
139
|
+
"content": "<html><head></head><body>Does late morning work for you?</body></html>",
|
|
140
|
+
},
|
|
141
|
+
"start": {"dateTime": "2017-04-15T11:00:00.0000000", "timeZone": "Pacific Standard Time"},
|
|
142
|
+
"end": {"dateTime": "2017-04-15T12:00:00.0000000", "timeZone": "Pacific Standard Time"},
|
|
143
|
+
"location": {
|
|
144
|
+
"displayName": "Harry's Bar",
|
|
145
|
+
"locationType": "default",
|
|
146
|
+
"uniqueId": "Harry's Bar",
|
|
147
|
+
"uniqueIdType": "private",
|
|
148
|
+
},
|
|
149
|
+
"locations": [{"displayName": "Harry's Bar", "locationType": "default", "uniqueIdType": "unknown"}],
|
|
150
|
+
"recurrence": None,
|
|
151
|
+
"attendees": [
|
|
152
|
+
{
|
|
153
|
+
"type": "required",
|
|
154
|
+
"status": {"response": "none", "time": "0001-01-01T00:00:00Z"},
|
|
155
|
+
"emailAddress": {"name": "Samantha Booth", "address": "samanthab@contoso.onmicrosoft.com"},
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"organizer": {"emailAddress": {"name": "Dana Swope", "address": "danas@contoso.onmicrosoft.com"}},
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@pytest.fixture()
|
|
162
|
+
def invitation_event_fixture(self, organizer_event_fixture):
|
|
163
|
+
invitation_event_fixture = copy.deepcopy(organizer_event_fixture)
|
|
164
|
+
invitation_event_fixture["isOrganizer"] = False
|
|
165
|
+
return invitation_event_fixture
|
|
166
|
+
|
|
167
|
+
@pytest.fixture()
|
|
168
|
+
def organizer_event_fixture_parsed(self):
|
|
169
|
+
return {
|
|
170
|
+
"odata_context": "https://graph.microsoft.com/v1.0/$metadata#users('cd209b0b-3f83-4c35-82d2-d88a61820480')/events/$entity",
|
|
171
|
+
"odata_etag": 'W/"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ=="',
|
|
172
|
+
"id": "AAMkAGI1AAAt9AHjAAA=",
|
|
173
|
+
"created_date_time": "2017-04-15T03:00:50.7579581Z",
|
|
174
|
+
"last_modified_date_time": "2017-04-15T03:00:51.245372Z",
|
|
175
|
+
"change_key": "ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==",
|
|
176
|
+
"categories": [],
|
|
177
|
+
"original_start_time_zone": "Pacific Standard Time",
|
|
178
|
+
"original_end_time_zone": "Pacific Standard Time",
|
|
179
|
+
"uid": "040000008200E00074C5B7101A82E00800000000DA2B357D94B5D201000000000000000010000000EC4597557F0CB34EA4CC2887EA7B17C3",
|
|
180
|
+
"reminder_minutes_before_start": 15,
|
|
181
|
+
"is_reminder_on": True,
|
|
182
|
+
"has_attachments": False,
|
|
183
|
+
"hide_attendees": False,
|
|
184
|
+
"subject": "Let's go brunch",
|
|
185
|
+
"body_preview": "Does noon work for you?",
|
|
186
|
+
"importance": "normal",
|
|
187
|
+
"sensitivity": "normal",
|
|
188
|
+
"is_all_day": False,
|
|
189
|
+
"is_cancelled": False,
|
|
190
|
+
"is_draft": False,
|
|
191
|
+
"is_organizer": True,
|
|
192
|
+
"response_requested": True,
|
|
193
|
+
"series_master_id": None,
|
|
194
|
+
"transaction_id": "7E163156-7762-4BEB-A1C6-729EA81755A7",
|
|
195
|
+
"show_as": "busy",
|
|
196
|
+
"type": "singleInstance",
|
|
197
|
+
"web_link": "https://outlook.office365.com/owa/?itemid=AAMkAGI1AAAt9AHjAAA%3D&exvsurl=1&path=/calendar/item",
|
|
198
|
+
"online_meeting_url": None,
|
|
199
|
+
"is_online_meeting": True,
|
|
200
|
+
"online_meeting_provider": "unknown",
|
|
201
|
+
"online_meeting": None,
|
|
202
|
+
"allow_new_time_proposals": True,
|
|
203
|
+
"locations": [{"displayName": "Harry's Bar", "locationType": "default", "uniqueIdType": "unknown"}],
|
|
204
|
+
"recurrence": None,
|
|
205
|
+
"attendees": [
|
|
206
|
+
{
|
|
207
|
+
"type": "required",
|
|
208
|
+
"status": {"response": "none", "time": "0001-01-01T00:00:00Z"},
|
|
209
|
+
"emailAddress": {"name": "Samantha Booth", "address": "samanthab@contoso.onmicrosoft.com"},
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"response_status.response": "organizer",
|
|
213
|
+
"response_status.time": "0001-01-01T00:00:00Z",
|
|
214
|
+
"body.content_type": "html",
|
|
215
|
+
"body.content": "<html><head></head><body>Does late morning work for you?</body></html>",
|
|
216
|
+
"start.date_time": "2017-04-15T11:00:00.0000000",
|
|
217
|
+
"start.time_zone": "Pacific Standard Time",
|
|
218
|
+
"end.date_time": "2017-04-15T12:00:00.0000000",
|
|
219
|
+
"end.time_zone": "Pacific Standard Time",
|
|
220
|
+
"location.display_name": "Harry's Bar",
|
|
221
|
+
"location.location_type": "default",
|
|
222
|
+
"location.unique_id": "Harry's Bar",
|
|
223
|
+
"location.unique_id_type": "private",
|
|
224
|
+
"organizer.email_address.name": "Dana Swope",
|
|
225
|
+
"organizer.email_address.address": "danas@contoso.onmicrosoft.com",
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@pytest.fixture()
|
|
229
|
+
def invitation_event_fixture_parsed(self, organizer_event_fixture_parsed):
|
|
230
|
+
invitation_event_fixture_parsed = copy.deepcopy(organizer_event_fixture_parsed)
|
|
231
|
+
invitation_event_fixture_parsed["is_organizer"] = False
|
|
232
|
+
return invitation_event_fixture_parsed
|
|
233
|
+
|
|
234
|
+
@pytest.fixture()
|
|
235
|
+
def organizer_master_event_fixture_parsed(self):
|
|
236
|
+
return {
|
|
237
|
+
"id": "unique_id2-ocurrence_pattern_id-unique_recurrence_id2",
|
|
238
|
+
"uid": "unique_fake_id",
|
|
239
|
+
"type": "seriesMaster",
|
|
240
|
+
"start.date_time": "2022-12-12T07:00:00.0000000",
|
|
241
|
+
"end.date_time": "2022-12-12T07:30:00.0000000",
|
|
242
|
+
"created": "2022-12-08T10:37:29.8938372Z",
|
|
243
|
+
"show_as": "busy",
|
|
244
|
+
"subject": "test recc",
|
|
245
|
+
"is_draft": False,
|
|
246
|
+
"web_link": "fake_web_link2",
|
|
247
|
+
"locations": [],
|
|
248
|
+
"categories": [],
|
|
249
|
+
"change_key": "fake_change_key2",
|
|
250
|
+
"importance": "normal",
|
|
251
|
+
"is_all_day": False,
|
|
252
|
+
"odata_etag": "fake_etag2",
|
|
253
|
+
"sensitivity": "normal",
|
|
254
|
+
"body.content": "",
|
|
255
|
+
"body_preview": "",
|
|
256
|
+
"is_cancelled": False,
|
|
257
|
+
"is_organizer": True,
|
|
258
|
+
"participants": [],
|
|
259
|
+
"end.time_zone": "UTC",
|
|
260
|
+
"last_modified": "2022-12-08T10:37:30.0188091Z",
|
|
261
|
+
"occurrence_id": None,
|
|
262
|
+
"odata_context": "fake_odata_context2",
|
|
263
|
+
"hide_attendees": False,
|
|
264
|
+
"is_reminder_on": True,
|
|
265
|
+
"online_meeting": None,
|
|
266
|
+
"transaction_id": "70957719-1fb2-5642-7bb6-c1363e1091e0",
|
|
267
|
+
"has_attachments": False,
|
|
268
|
+
"start.time_zone": "UTC",
|
|
269
|
+
"series_master_id": None,
|
|
270
|
+
"body.content_type": "html",
|
|
271
|
+
"is_online_meeting": False,
|
|
272
|
+
"online_meeting_url": None,
|
|
273
|
+
"response_requested": True,
|
|
274
|
+
"response_status.time": "0001-01-01T00:00:00Z",
|
|
275
|
+
"location.address.type": "unknown",
|
|
276
|
+
"location.display_name": "",
|
|
277
|
+
"recurrence.range.type": "endDate",
|
|
278
|
+
"location.location_type": "default",
|
|
279
|
+
"original_end_time_zone": "W. Europe Standard Time",
|
|
280
|
+
"location.unique_id_type": "unknown",
|
|
281
|
+
"online_meeting_provider": "unknown",
|
|
282
|
+
"recurrence.pattern.type": "daily",
|
|
283
|
+
"allow_new_time_proposals": True,
|
|
284
|
+
"original_start_time_zone": "W. Europe Standard Time",
|
|
285
|
+
"recurrence.pattern.index": "first",
|
|
286
|
+
"recurrence.pattern.month": 0,
|
|
287
|
+
"response_status.response": "organizer",
|
|
288
|
+
"recurrence.range.end_date": "2022-12-14",
|
|
289
|
+
"recurrence.pattern.interval": 1,
|
|
290
|
+
"recurrence.range.start_date": "2022-12-12",
|
|
291
|
+
"organizer.email_address.name": "Fake organizer name",
|
|
292
|
+
"calendar@odata.navigationLink": "fake_navigation_link",
|
|
293
|
+
"reminder_minutes_before_start": 15,
|
|
294
|
+
"calendar@odata.associationLink": "fake_association_link",
|
|
295
|
+
"organizer.email_address.address": "test@test.com",
|
|
296
|
+
"recurrence.pattern.day_of_month": 0,
|
|
297
|
+
"recurrence.pattern.first_day_of_week": "sunday",
|
|
298
|
+
"recurrence.range.recurrence_time_zone": "W. Europe Standard Time",
|
|
299
|
+
"recurrence.range.number_of_occurrences": 0,
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@pytest.fixture()
|
|
303
|
+
def teams_event_fixture(self):
|
|
304
|
+
return {
|
|
305
|
+
"odata_etag": 'W/"AAAAAAAAAAAAAAAAA=="',
|
|
306
|
+
"id": "eventid1",
|
|
307
|
+
"created_date_time": "2023-12-14T10:23:43.4384008Z",
|
|
308
|
+
"last_modified_date_time": "2023-12-14T10:25:13.7822553Z",
|
|
309
|
+
"change_key": "AAAAAAAAAAAAAAAAA==",
|
|
310
|
+
"categories": [],
|
|
311
|
+
"transaction_id": None,
|
|
312
|
+
"original_start_time_zone": "UTC",
|
|
313
|
+
"original_end_time_zone": "UTC",
|
|
314
|
+
"uid": "eventuid1",
|
|
315
|
+
"reminder_minutes_before_start": 15,
|
|
316
|
+
"is_reminder_on": True,
|
|
317
|
+
"has_attachments": False,
|
|
318
|
+
"subject": "Canceled: Weekly Office meeting",
|
|
319
|
+
"body_preview": "________________________________________________________________________________\r\nRéunion Microsoft Teams\r\nParticipez à partir de votre ordinateur, de votre application mobile ou de l’appareil de la salle\r\nCliquez ici pour rejoindre la réunion\r\nID de la",
|
|
320
|
+
"importance": "normal",
|
|
321
|
+
"sensitivity": "normal",
|
|
322
|
+
"is_all_day": False,
|
|
323
|
+
"is_cancelled": False,
|
|
324
|
+
"is_organizer": False,
|
|
325
|
+
"response_requested": True,
|
|
326
|
+
"series_master_id": None,
|
|
327
|
+
"show_as": "free",
|
|
328
|
+
"type": "singleInstance",
|
|
329
|
+
"web_link": "https://test.ch",
|
|
330
|
+
"online_meeting_url": None,
|
|
331
|
+
"is_online_meeting": True,
|
|
332
|
+
"online_meeting_provider": "teamsForBusiness",
|
|
333
|
+
"allow_new_time_proposals": True,
|
|
334
|
+
"occurrence_id": None,
|
|
335
|
+
"is_draft": False,
|
|
336
|
+
"hide_attendees": False,
|
|
337
|
+
"locations": [
|
|
338
|
+
{
|
|
339
|
+
"displayName": "Microsoft Teams Meeting",
|
|
340
|
+
"locationType": "default",
|
|
341
|
+
"uniqueId": "Microsoft Teams Meeting",
|
|
342
|
+
"uniqueIdType": "private",
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"recurrence": None,
|
|
346
|
+
"attendees": [
|
|
347
|
+
{
|
|
348
|
+
"type": "required",
|
|
349
|
+
"status": {"response": "none", "time": "0001-01-01T00:00:00Z"},
|
|
350
|
+
"emailAddress": {"name": "organizer1", "address": "organizer1@test.ch"},
|
|
351
|
+
},
|
|
352
|
+
*[
|
|
353
|
+
{
|
|
354
|
+
"type": "optional",
|
|
355
|
+
"status": {"response": "none", "time": "0001-01-01T00:00:00Z"},
|
|
356
|
+
"emailAddress": {"name": f"attendee{i}", "address": f"attendee{i}@atonra.ch"},
|
|
357
|
+
}
|
|
358
|
+
for i in range(1, 15)
|
|
359
|
+
],
|
|
360
|
+
],
|
|
361
|
+
"response_status.response": "notResponded",
|
|
362
|
+
"response_status.time": "0001-01-01T00:00:00Z",
|
|
363
|
+
"body.content_type": "html",
|
|
364
|
+
"start.date_time": "2023-12-18T08:30:00.0000000",
|
|
365
|
+
"start.time_zone": "UTC",
|
|
366
|
+
"end.date_time": "2023-12-18T10:00:00.0000000",
|
|
367
|
+
"end.time_zone": "UTC",
|
|
368
|
+
"location.display_name": "Microsoft Teams Meeting",
|
|
369
|
+
"location.location_type": "default",
|
|
370
|
+
"location.unique_id": "Microsoft Teams Meeting",
|
|
371
|
+
"location.unique_id_type": "private",
|
|
372
|
+
"organizer.email_address.name": "organizer1",
|
|
373
|
+
"organizer.email_address.address": "organizer1@atonra.ch",
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
@pytest.fixture()
|
|
377
|
+
def canceled_teams_event_fixture(self, teams_event_fixture):
|
|
378
|
+
canceled_event = copy.deepcopy(teams_event_fixture)
|
|
379
|
+
canceled_event["is_cancelled"] = True
|
|
380
|
+
return canceled_event
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
# recurrence_event = {
|
|
384
|
+
# "id": "unique_id2-ocurrence_pattern_id-unique_recurrence_id2",
|
|
385
|
+
# "uid": event.get("uid"),
|
|
386
|
+
# "type": "seriesMaster",
|
|
387
|
+
# "start": "2022-12-12T07:00:00.0000000",
|
|
388
|
+
# "end": "2022-12-12T07:30:00.0000000",
|
|
389
|
+
# "created": "2022-12-08T10:37:29.8938372Z",
|
|
390
|
+
# "show_as": "busy",
|
|
391
|
+
# "subject": "test recc",
|
|
392
|
+
# "is_draft": False,
|
|
393
|
+
# "web_link": "fake_web_link2",
|
|
394
|
+
# "locations": [],
|
|
395
|
+
# "categories": [],
|
|
396
|
+
# "change_key": "fake_change_key2",
|
|
397
|
+
# "importance": "normal",
|
|
398
|
+
# "is_all_day": False,
|
|
399
|
+
# "odata_etag": "fake_etag2",
|
|
400
|
+
# "sensitivity": "normal",
|
|
401
|
+
# "body.content": "",
|
|
402
|
+
# "body_preview": "",
|
|
403
|
+
# "is_cancelled": False,
|
|
404
|
+
# "is_organizer": True,
|
|
405
|
+
# "participants": [],
|
|
406
|
+
# "end.time_zone": "UTC",
|
|
407
|
+
# "last_modified": "2022-12-08T10:37:30.0188091Z",
|
|
408
|
+
# "occurrence_id": None,
|
|
409
|
+
# "odata_context": "fake_odata_context2",
|
|
410
|
+
# "hide_attendees": False,
|
|
411
|
+
# "is_reminder_on": True,
|
|
412
|
+
# "online_meeting": None,
|
|
413
|
+
# "transaction_id": "70957719-1fb2-5642-7bb6-c1363e1091e0",
|
|
414
|
+
# "has_attachments": False,
|
|
415
|
+
# "start.time_zone": "UTC",
|
|
416
|
+
# "series_master_id": None,
|
|
417
|
+
# "body.content_type": "html",
|
|
418
|
+
# "is_online_meeting": False,
|
|
419
|
+
# "online_meeting_url": None,
|
|
420
|
+
# "response_requested": True,
|
|
421
|
+
# "response_status.time": "0001-01-01T00:00:00Z",
|
|
422
|
+
# "location.address.type": "unknown",
|
|
423
|
+
# "location.display_name": "",
|
|
424
|
+
# "recurrence.range.type": "endDate",
|
|
425
|
+
# "location.location_type": "default",
|
|
426
|
+
# "original_end_time_zone": "W. Europe Standard Time",
|
|
427
|
+
# "location.unique_id_type": "unknown",
|
|
428
|
+
# "online_meeting_provider": "unknown",
|
|
429
|
+
# "recurrence.pattern.type": "daily",
|
|
430
|
+
# "allow_new_time_proposals": True,
|
|
431
|
+
# "original_start_time_zone": "W. Europe Standard Time",
|
|
432
|
+
# "recurrence.pattern.index": "first",
|
|
433
|
+
# "recurrence.pattern.month": 0,
|
|
434
|
+
# "response_status.response": "organizer",
|
|
435
|
+
# "recurrence.range.end_date": "2022-12-14",
|
|
436
|
+
# "recurrence.pattern.interval": 1,
|
|
437
|
+
# "recurrence.range.start_date": "2022-12-12",
|
|
438
|
+
# "organizer.email_address.name": "Fake organizer name",
|
|
439
|
+
# "calendar@odata.navigationLink": "fake_navigation_link",
|
|
440
|
+
# "reminder_minutes_before_start": 15,
|
|
441
|
+
# "calendar@odata.associationLink": "fake_association_link",
|
|
442
|
+
# "organizer.email_address.address": "test@test.com",
|
|
443
|
+
# "recurrence.pattern.day_of_month": 0,
|
|
444
|
+
# "recurrence.pattern.first_day_of_week": "sunday",
|
|
445
|
+
# "recurrence.range.recurrence_time_zone": "W. Europe Standard Time",
|
|
446
|
+
# "recurrence.range.number_of_occurrences": 0,
|
|
447
|
+
# }
|
|
448
|
+
|
|
449
|
+
# occurrences_event = [
|
|
450
|
+
# {
|
|
451
|
+
# "id": "unique_id001-ocurrence_pattern_id-unique_recurrence_id2",
|
|
452
|
+
# "end": "2022-12-12T07:30:00.0000000",
|
|
453
|
+
# "uid": event.get("uid"),
|
|
454
|
+
# "type": "occurrence",
|
|
455
|
+
# "start": "2022-12-12T07:00:00.0000000",
|
|
456
|
+
# "created": "2022-12-08T10:37:29.8938372Z",
|
|
457
|
+
# "show_as": "busy",
|
|
458
|
+
# "subject": "test recc",
|
|
459
|
+
# "is_draft": False,
|
|
460
|
+
# "web_link": "weblink",
|
|
461
|
+
# "locations": [],
|
|
462
|
+
# "categories": [],
|
|
463
|
+
# "change_key": "changekey1",
|
|
464
|
+
# "importance": "normal",
|
|
465
|
+
# "is_all_day": False,
|
|
466
|
+
# "odata_etag": "etag1",
|
|
467
|
+
# "recurrence": None,
|
|
468
|
+
# "sensitivity": "normal",
|
|
469
|
+
# "body.content": "",
|
|
470
|
+
# "body_preview": "",
|
|
471
|
+
# "is_cancelled": False,
|
|
472
|
+
# "is_organizer": True,
|
|
473
|
+
# "participants": [],
|
|
474
|
+
# "end.time_zone": "UTC",
|
|
475
|
+
# "last_modified": "2022-12-08T10:37:30.0188091Z",
|
|
476
|
+
# "occurrence_id": "OID.unique_id2-ocurrence_pattern_id-unique_recurrence_id2.2022-12-12",
|
|
477
|
+
# "hide_attendees": False,
|
|
478
|
+
# "is_reminder_on": True,
|
|
479
|
+
# "online_meeting": None,
|
|
480
|
+
# "transaction_id": "fake_transaction_id",
|
|
481
|
+
# "has_attachments": False,
|
|
482
|
+
# "start.time_zone": "UTC",
|
|
483
|
+
# "series_master_id": "unique_id2-ocurrence_pattern_id-unique_recurrence_id2",
|
|
484
|
+
# "body.content_type": "html",
|
|
485
|
+
# "is_online_meeting": False,
|
|
486
|
+
# "online_meeting_url": None,
|
|
487
|
+
# "response_requested": True,
|
|
488
|
+
# "response_status.time": "0001-01-01T00:00:00Z",
|
|
489
|
+
# "location.address.type": "unknown",
|
|
490
|
+
# "location.display_name": "",
|
|
491
|
+
# "location.location_type": "default",
|
|
492
|
+
# "original_end_time_zone": "W. Europe Standard Time",
|
|
493
|
+
# "location.unique_id_type": "unknown",
|
|
494
|
+
# "online_meeting_provider": "unknown",
|
|
495
|
+
# "allow_new_time_proposals": True,
|
|
496
|
+
# "original_start_time_zone": "W. Europe Standard Time",
|
|
497
|
+
# "response_status.response": "organizer",
|
|
498
|
+
# "organizer.email_address.name": "Fake organizer name",
|
|
499
|
+
# "reminder_minutes_before_start": 15,
|
|
500
|
+
# "organizer.email_address.address": "test@test.com",
|
|
501
|
+
# },
|
|
502
|
+
# {
|
|
503
|
+
# "id": "unique_id002-ocurrence_pattern_id-unique_recurrence_id2",
|
|
504
|
+
# "end": "2022-12-13T07:30:00.0000000",
|
|
505
|
+
# "uid": event.get("uid"),
|
|
506
|
+
# "type": "occurrence",
|
|
507
|
+
# "start": "2022-12-13T07:00:00.0000000",
|
|
508
|
+
# "created": "2022-12-08T10:37:29.8938372Z",
|
|
509
|
+
# "show_as": "busy",
|
|
510
|
+
# "subject": "test recc",
|
|
511
|
+
# "is_draft": False,
|
|
512
|
+
# "web_link": "weblink",
|
|
513
|
+
# "locations": [],
|
|
514
|
+
# "categories": [],
|
|
515
|
+
# "change_key": "changekey1",
|
|
516
|
+
# "importance": "normal",
|
|
517
|
+
# "is_all_day": False,
|
|
518
|
+
# "odata_etag": "etag1",
|
|
519
|
+
# "recurrence": None,
|
|
520
|
+
# "sensitivity": "normal",
|
|
521
|
+
# "body.content": "",
|
|
522
|
+
# "body_preview": "",
|
|
523
|
+
# "is_cancelled": False,
|
|
524
|
+
# "is_organizer": True,
|
|
525
|
+
# "participants": [],
|
|
526
|
+
# "end.time_zone": "UTC",
|
|
527
|
+
# "last_modified": "2022-12-08T10:37:30.0188091Z",
|
|
528
|
+
# "occurrence_id": "OID.unique_id2-ocurrence_pattern_id-unique_recurrence_id2.2022-12-13",
|
|
529
|
+
# "hide_attendees": False,
|
|
530
|
+
# "is_reminder_on": True,
|
|
531
|
+
# "online_meeting": None,
|
|
532
|
+
# "transaction_id": "transaction1",
|
|
533
|
+
# "has_attachments": False,
|
|
534
|
+
# "start.time_zone": "UTC",
|
|
535
|
+
# "series_master_id": "unique_id2-ocurrence_pattern_id-unique_recurrence_id2",
|
|
536
|
+
# "body.content_type": "html",
|
|
537
|
+
# "is_online_meeting": False,
|
|
538
|
+
# "online_meeting_url": None,
|
|
539
|
+
# "response_requested": True,
|
|
540
|
+
# "response_status.time": "0001-01-01T00:00:00Z",
|
|
541
|
+
# "location.address.type": "unknown",
|
|
542
|
+
# "location.display_name": "",
|
|
543
|
+
# "location.location_type": "default",
|
|
544
|
+
# "original_end_time_zone": "W. Europe Standard Time",
|
|
545
|
+
# "location.unique_id_type": "unknown",
|
|
546
|
+
# "online_meeting_provider": "unknown",
|
|
547
|
+
# "allow_new_time_proposals": True,
|
|
548
|
+
# "original_start_time_zone": "W. Europe Standard Time",
|
|
549
|
+
# "response_status.response": "organizer",
|
|
550
|
+
# "organizer.email_address.name": "Fake organizer name",
|
|
551
|
+
# "reminder_minutes_before_start": 15,
|
|
552
|
+
# "organizer.email_address.address": "test@test.com",
|
|
553
|
+
# },
|
|
554
|
+
# {
|
|
555
|
+
# "id": "unique_id003-ocurrence_pattern_id-unique_recurrence_id2",
|
|
556
|
+
# "end": "2022-12-14T07:30:00.0000000",
|
|
557
|
+
# "uid": event.get("uid"),
|
|
558
|
+
# "type": "occurrence",
|
|
559
|
+
# "start": "2022-12-14T07:00:00.0000000",
|
|
560
|
+
# "created": "2022-12-08T10:37:29.8938372Z",
|
|
561
|
+
# "show_as": "busy",
|
|
562
|
+
# "subject": "test recc",
|
|
563
|
+
# "is_draft": False,
|
|
564
|
+
# "web_link": "weblink4",
|
|
565
|
+
# "locations": [],
|
|
566
|
+
# "categories": [],
|
|
567
|
+
# "change_key": "change_key5",
|
|
568
|
+
# "importance": "normal",
|
|
569
|
+
# "is_all_day": False,
|
|
570
|
+
# "odata_etag": "etag3",
|
|
571
|
+
# "recurrence": None,
|
|
572
|
+
# "sensitivity": "normal",
|
|
573
|
+
# "body.content": "",
|
|
574
|
+
# "body_preview": "",
|
|
575
|
+
# "is_cancelled": False,
|
|
576
|
+
# "is_organizer": True,
|
|
577
|
+
# "participants": [],
|
|
578
|
+
# "end.time_zone": "UTC",
|
|
579
|
+
# "last_modified": "2022-12-08T10:37:30.0188091Z",
|
|
580
|
+
# "occurrence_id": "OID.unique_id2-ocurrence_pattern_id-unique_recurrence_id2..2022-12-14",
|
|
581
|
+
# "hide_attendees": False,
|
|
582
|
+
# "is_reminder_on": True,
|
|
583
|
+
# "online_meeting": None,
|
|
584
|
+
# "transaction_id": "transaction3",
|
|
585
|
+
# "has_attachments": False,
|
|
586
|
+
# "start.time_zone": "UTC",
|
|
587
|
+
# "series_master_id": "unique_id2-ocurrence_pattern_id-unique_recurrence_id2",
|
|
588
|
+
# "body.content_type": "html",
|
|
589
|
+
# "is_online_meeting": False,
|
|
590
|
+
# "online_meeting_url": None,
|
|
591
|
+
# "response_requested": True,
|
|
592
|
+
# "response_status.time": "0001-01-01T00:00:00Z",
|
|
593
|
+
# "location.address.type": "unknown",
|
|
594
|
+
# "location.display_name": "",
|
|
595
|
+
# "location.location_type": "default",
|
|
596
|
+
# "original_end_time_zone": "W. Europe Standard Time",
|
|
597
|
+
# "location.unique_id_type": "unknown",
|
|
598
|
+
# "online_meeting_provider": "unknown",
|
|
599
|
+
# "allow_new_time_proposals": True,
|
|
600
|
+
# "original_start_time_zone": "W. Europe Standard Time",
|
|
601
|
+
# "response_status.response": "organizer",
|
|
602
|
+
# "organizer.email_address.name": "Fake organizer name",
|
|
603
|
+
# "reminder_minutes_before_start": 15,
|
|
604
|
+
# "organizer.email_address.address": "test@test.com",
|
|
605
|
+
# },
|
|
606
|
+
# ]
|