-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added duplicate contacts tabs, fixed time format in marketing campaig…
…n list page, added test cases in marketing, added contacts list filter in contacts page (#284) * updated testcases, update code for account view page, modified code for attachments and comments for assigned user * updated testcases in events, invoices, tasks modules * added duplicate contacts tabs, fixed time format in marketing campaign list page, added test cases in marketing, added contacts list filter in contacts page
- Loading branch information
KingCSharp
committed
Sep 10, 2019
1 parent
fae231f
commit 547656d
Showing
62 changed files
with
3,083 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[report] | ||
exclude_lines = | ||
# lines with this comment are not hit | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __unicode__ | ||
def __repr__ | ||
def __str__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: | ||
|
||
except Exception as e: | ||
except Exception: | ||
|
||
omit = | ||
*tests* | ||
./settings/* | ||
./*/migrations/* | ||
./*/apps.py | ||
./*/admin.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from datetime import datetime, timedelta | ||
|
||
from django.test import TestCase | ||
from django.test.utils import override_settings | ||
|
||
from accounts.models import Email | ||
from accounts.tasks import (send_email, send_email_to_assigned_user, | ||
send_scheduled_emails) | ||
from accounts.tests import AccountCreateTest | ||
|
||
|
||
class TestCeleryTasks(AccountCreateTest, TestCase): | ||
|
||
@override_settings(CELERY_EAGER_PROPAGATES_EXCEPTIONS=True, | ||
CELERY_ALWAYS_EAGER=True, | ||
BROKER_BACKEND='memory') | ||
def test_celery_tasks(self): | ||
email_scheduled = Email.objects.create( | ||
message_subject='message subject', message_body='message body', | ||
scheduled_later=True, timezone='Asia/Kolkata', | ||
from_account=self.account, | ||
scheduled_date_time=(datetime.now() - timedelta(minutes=5)), | ||
from_email='[email protected]' | ||
) | ||
email_scheduled.recipients.add(self.contact.id, self.contact_user1.id) | ||
task = send_scheduled_emails.apply() | ||
self.assertEqual('SUCCESS', task.state) | ||
|
||
task = send_email.apply((email_scheduled.id,)) | ||
self.assertEqual('SUCCESS', task.state) | ||
|
||
task = send_email_to_assigned_user.apply( | ||
([self.user.id, self.user1.id, ], self.account.id,),) | ||
self.assertEqual('SUCCESS', task.state) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.test import TestCase | ||
from django.test.utils import override_settings | ||
|
||
from cases.tasks import send_email_to_assigned_user | ||
from cases.tests import CaseCreation | ||
|
||
|
||
class TestCeleryTasks(CaseCreation, TestCase): | ||
|
||
@override_settings(CELERY_EAGER_PROPAGATES_EXCEPTIONS=True, | ||
CELERY_ALWAYS_EAGER=True, | ||
BROKER_BACKEND='memory') | ||
def test_celery_tasks(self): | ||
task = send_email_to_assigned_user.apply( | ||
([self.user.id, self.user1.id, ], self.case.id,),) | ||
self.assertEqual('SUCCESS', task.state) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.