edx-ace 1.11.0__py2.py3-none-any.whl → 1.11.1__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.
- edx_ace/__init__.py +1 -1
- edx_ace/delivery.py +0 -1
- edx_ace/tests/test_delivery.py +20 -2
- {edx_ace-1.11.0.dist-info → edx_ace-1.11.1.dist-info}/METADATA +1 -1
- {edx_ace-1.11.0.dist-info → edx_ace-1.11.1.dist-info}/RECORD +9 -9
- {edx_ace-1.11.0.dist-info → edx_ace-1.11.1.dist-info}/LICENSE.txt +0 -0
- {edx_ace-1.11.0.dist-info → edx_ace-1.11.1.dist-info}/WHEEL +0 -0
- {edx_ace-1.11.0.dist-info → edx_ace-1.11.1.dist-info}/entry_points.txt +0 -0
- {edx_ace-1.11.0.dist-info → edx_ace-1.11.1.dist-info}/top_level.txt +0 -0
edx_ace/__init__.py
CHANGED
edx_ace/delivery.py
CHANGED
@@ -67,4 +67,3 @@ def deliver(channel, rendered_message, message):
|
|
67
67
|
delivery_expired_report = f'{channel_type}_delivery_expired'
|
68
68
|
logger.debug(delivery_expired_report)
|
69
69
|
message.report(delivery_expired_report, get_current_time() - start_time)
|
70
|
-
ACE_MESSAGE_SENT.send(sender=channel, message=message)
|
edx_ace/tests/test_delivery.py
CHANGED
@@ -34,21 +34,26 @@ class TestDelivery(TestCase): # pylint: disable=missing-class-docstring
|
|
34
34
|
)
|
35
35
|
self.current_time = datetime.datetime.utcnow().replace(tzinfo=tzutc())
|
36
36
|
|
37
|
-
|
37
|
+
@patch('edx_ace.delivery.ACE_MESSAGE_SENT.send')
|
38
|
+
def test_happy_path(self, mock_ace_message_sent):
|
38
39
|
deliver(self.mock_channel, sentinel.rendered_email, self.message)
|
39
40
|
self.mock_channel.deliver.assert_called_once_with(self.message, sentinel.rendered_email)
|
41
|
+
# check if ACE_MESSAGE_SENT is raised
|
42
|
+
mock_ace_message_sent.assert_called_once_with(sender=self.mock_channel, message=self.message)
|
40
43
|
|
41
44
|
def test_fatal_error(self):
|
42
45
|
self.mock_channel.deliver.side_effect = FatalChannelDeliveryError('testing')
|
43
46
|
with self.assertRaises(FatalChannelDeliveryError):
|
44
47
|
deliver(self.mock_channel, sentinel.rendered_email, self.message)
|
45
48
|
|
49
|
+
@patch('edx_ace.delivery.ACE_MESSAGE_SENT.send')
|
46
50
|
@patch('edx_ace.delivery.get_current_time')
|
47
|
-
def test_custom_message_expiration(self, mock_get_current_time):
|
51
|
+
def test_custom_message_expiration(self, mock_get_current_time, mock_ace_message_sent):
|
48
52
|
self.message.expiration_time = self.current_time - datetime.timedelta(seconds=10)
|
49
53
|
mock_get_current_time.return_value = self.current_time
|
50
54
|
deliver(self.mock_channel, sentinel.rendered_email, self.message)
|
51
55
|
assert not self.mock_channel.deliver.called
|
56
|
+
mock_ace_message_sent.assert_not_called()
|
52
57
|
|
53
58
|
@patch('edx_ace.delivery.time')
|
54
59
|
@patch('edx_ace.delivery.get_current_time')
|
@@ -100,3 +105,16 @@ class TestDelivery(TestCase): # pylint: disable=missing-class-docstring
|
|
100
105
|
deliver(self.mock_channel, sentinel.rendered_email, self.message)
|
101
106
|
assert mock_time.sleep.call_args_list == [call(1), call(1)]
|
102
107
|
assert self.mock_channel.deliver.call_count == 3
|
108
|
+
|
109
|
+
@patch('edx_ace.delivery.ACE_MESSAGE_SENT.send')
|
110
|
+
def test_message_sent_signal_for_push_channel(self, mock_ace_message_sent):
|
111
|
+
"""
|
112
|
+
Test that ACE_MESSAGE_SENT signal is sent when a message is delivered to a push channel.
|
113
|
+
"""
|
114
|
+
mock_push_channel = Mock(
|
115
|
+
name='push_channel',
|
116
|
+
channel_type=ChannelType.PUSH
|
117
|
+
)
|
118
|
+
deliver(mock_push_channel, sentinel.rendered_email, self.message)
|
119
|
+
# check if ACE_MESSAGE_SENT is raised
|
120
|
+
mock_ace_message_sent.assert_called_once_with(sender=mock_push_channel, message=self.message)
|
@@ -1,7 +1,7 @@
|
|
1
|
-
edx_ace/__init__.py,sha256=
|
1
|
+
edx_ace/__init__.py,sha256=NNRZBB6kXsBqSeXn-kM6K_JUeSKuKmsOrDq7zJFW1ec,636
|
2
2
|
edx_ace/ace.py,sha256=0nP8zvIWiME4qmpMT1PaV4nRDG6YR9Dxm7A6FGoBa8I,2501
|
3
3
|
edx_ace/apps.py,sha256=xNedkdW6TNpm-W1uxnj3Vre2R1akkh2n_7DkSfKXmAk,216
|
4
|
-
edx_ace/delivery.py,sha256=
|
4
|
+
edx_ace/delivery.py,sha256=m_IOo4HTuuMZ61OOBZCA_TgLcfrME8BidWDutJmnaY0,2802
|
5
5
|
edx_ace/errors.py,sha256=y0MqT55qXLkpn_r5LVhHcYuU2-zHs56CQTAbNCqb72k,1065
|
6
6
|
edx_ace/message.py,sha256=lhmPor9vnaLvC4NPyRgB-obpGjGv9Lni0obcOUTgyCg,8340
|
7
7
|
edx_ace/monitoring.py,sha256=6nEcAJMCr9keCTJw9JjGecTg_J1ubcGJfuGiFq2B8G4,257
|
@@ -24,7 +24,7 @@ edx_ace/templatetags/acetags.py,sha256=CFVLb1j7oCN0mNNOpjaUHqQBEGlYZyRUgbYr9vS-S
|
|
24
24
|
edx_ace/test_utils/__init__.py,sha256=HfJqvOqVNFS0dMpj4TnnXrTWHO8nutRFdA1Qja7ktfY,1087
|
25
25
|
edx_ace/tests/test_ace.py,sha256=H5ss4ah-v5XDJ47udl6Ob6iSVdcX0qkjPI2h0kgWp1k,3278
|
26
26
|
edx_ace/tests/test_date.py,sha256=RteoiCrc269BXnIerrtz8I0K1weldZ_Qg9Oc0Nd8ixs,639
|
27
|
-
edx_ace/tests/test_delivery.py,sha256=
|
27
|
+
edx_ace/tests/test_delivery.py,sha256=0NYvFRWWcbEIdv5LE17EdYYcf9SE5g7mspC8poqPpNQ,5796
|
28
28
|
edx_ace/tests/test_message.py,sha256=uAf3XltW605WieNGdi0u5p6bY_oSqLsmV5pHU3J_TiQ,4430
|
29
29
|
edx_ace/tests/test_policy.py,sha256=T6Mm_q1Bi935WMBPS7sK5XbXM5izQ3y0KW0yiaQ5_GU,1597
|
30
30
|
edx_ace/tests/test_presentation.py,sha256=elgVz_sR04h3KKs73G0qQBzt0CazOPWKrDF2rVC_R4U,541
|
@@ -40,9 +40,9 @@ edx_ace/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
40
|
edx_ace/utils/date.py,sha256=Rmz3RAUCdd30hu1qcKH7FmAypaw1aSoZg-yfZig1c8A,1483
|
41
41
|
edx_ace/utils/once.py,sha256=sY3szBh3gvvAjrKbKq4S2mCejompjh5YcYD7XOhzjGU,2024
|
42
42
|
edx_ace/utils/plugins.py,sha256=U-l-eU2uWUiiwYV-H-2DfmwjoksqskAsYwS7QnThy2Q,2090
|
43
|
-
edx_ace-1.11.
|
44
|
-
edx_ace-1.11.
|
45
|
-
edx_ace-1.11.
|
46
|
-
edx_ace-1.11.
|
47
|
-
edx_ace-1.11.
|
48
|
-
edx_ace-1.11.
|
43
|
+
edx_ace-1.11.1.dist-info/LICENSE.txt,sha256=VrSJ4gO4NCpskzfNHbaTB4VcN9Q213YdcHbpOZSwcOA,35138
|
44
|
+
edx_ace-1.11.1.dist-info/METADATA,sha256=eTDhK8s6zluZDzmrBoanH8CN3hoVOqyVr8igrUydmi0,10106
|
45
|
+
edx_ace-1.11.1.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
|
46
|
+
edx_ace-1.11.1.dist-info/entry_points.txt,sha256=fiR8u0PqGyp2qIiJxcSrYhIZ3gEwl0vIMnTPWegXwRI,332
|
47
|
+
edx_ace-1.11.1.dist-info/top_level.txt,sha256=5eg_80KI88VkeiCVqZUqcYcc_PfPOg8o1GA4HxsiRU8,8
|
48
|
+
edx_ace-1.11.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|