-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from rootstrap/enhancement/indentation
Change indentation according to standard definition
- Loading branch information
Showing
8 changed files
with
220 additions
and
119 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
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 |
---|---|---|
|
@@ -13,7 +13,11 @@ class PlainDripEmail(DripMessage): | |
def message(self): | ||
if not self._message: | ||
email = mail.EmailMessage( | ||
self.subject, self.plain, self.from_email, [self.user.email]) | ||
self.subject, | ||
self.plain, | ||
self.from_email, | ||
[self.user.email], | ||
) | ||
self._message = email | ||
return self._message | ||
|
||
|
@@ -24,12 +28,14 @@ def setUp(self): | |
|
||
self.old_msg_classes = getattr(settings, 'DRIP_MESSAGE_CLASSES', None) | ||
self.user = self.User.objects.create( | ||
username='customuser', email='[email protected]') | ||
username='customuser', | ||
email='[email protected]', | ||
) | ||
self.model_drip = Drip.objects.create( | ||
name='A Custom Week Ago', | ||
subject_template='HELLO {{ user.username }}', | ||
body_html_template='<h2>This</h2> is an <b>example</b>' | ||
' html <strong>body</strong>.' | ||
' html <strong>body</strong>.', | ||
) | ||
QuerySetRule.objects.create( | ||
drip=self.model_drip, | ||
|
@@ -63,7 +69,8 @@ def test_custom_added_not_used(self): | |
|
||
def test_custom_added_and_used(self): | ||
settings.DRIP_MESSAGE_CLASSES = { | ||
'plain': 'drip.tests.test_custom_messages.PlainDripEmail'} | ||
'plain': 'drip.tests.test_custom_messages.PlainDripEmail', | ||
} | ||
self.model_drip.message_class = 'plain' | ||
self.model_drip.save() | ||
result = self.model_drip.drip.send() | ||
|
@@ -76,7 +83,8 @@ def test_custom_added_and_used(self): | |
|
||
def test_override_default(self): | ||
settings.DRIP_MESSAGE_CLASSES = { | ||
'default': 'drip.tests.test_custom_messages.PlainDripEmail'} | ||
'default': 'drip.tests.test_custom_messages.PlainDripEmail', | ||
} | ||
result = self.model_drip.drip.send() | ||
self.assertEqual(1, result) | ||
self.assertEqual(1, len(mail.outbox)) | ||
|
Oops, something went wrong.