| Total Complexity | 2 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
|
|
|||
| 2 | import os |
||
| 3 | import re |
||
| 4 | |||
| 5 | from nose.tools import eq_ |
||
| 6 | from nose.tools import ok_ |
||
| 7 | |||
| 8 | from tracim.lib.core.notifications import DummyNotifier |
||
| 9 | from tracim.lib.core.notifications import EmailNotifier |
||
| 10 | from tracim.lib.core.notifications import NotifierFactory |
||
| 11 | from tracim.models.auth import User |
||
| 12 | from tracim.models.data import Content |
||
| 13 | from tracim.tests import DefaultTest |
||
| 14 | |||
| 15 | |||
| 16 | class TestDummyNotifier(DefaultTest): |
||
| 17 | |||
| 18 | def test_dummy_notifier__notify_content_update(self): |
||
| 19 | c = Content() |
||
| 20 | notifier = DummyNotifier(self.app_config) |
||
| 21 | notifier.notify_content_update(c) |
||
| 22 | # INFO - D.A. - 2014-12-09 - |
||
| 23 | # Old notification_content_update raised an exception |
||
| 24 | |||
| 25 | |||
| 26 | class TestNotifierFactory(DefaultTest): |
||
| 27 | def test_notifier_factory_method(self): |
||
| 28 | u = User() |
||
| 29 | |||
| 30 | self.app_config.EMAIL_NOTIFICATION_ACTIVATED = True |
||
| 31 | notifier = NotifierFactory.create(self.app_config, u) |
||
| 32 | eq_(EmailNotifier, notifier.__class__) |
||
| 33 | |||
| 34 | self.app_config.EMAIL_NOTIFICATION_ACTIVATED = False |
||
| 35 | notifier = NotifierFactory.create(self.app_config, u) |
||
| 36 | eq_(DummyNotifier, notifier.__class__) |
||
| 37 | |||
| 38 | |||
| 39 | class TestEmailNotifier(DefaultTest): |
||
| 40 | # TODO - G.M - 04-03-2017 - [emailNotif] - Restore test for email Notif |
||
| 41 | pass |
||
| 42 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.