forked from mmmaly/chcemvediet
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7c76fa
commit aa028f0
Showing
5 changed files
with
81 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,6 +272,8 @@ def _render(self, template, **context): | |
def setUp(self): | ||
self.tempdir = TempDirectory() | ||
self.settings_override = override_settings( | ||
TEMPLATE_LOADERS=((u'poleno.utils.template.TranslationLoader', u'django.template.loaders.filesystem.Loader'), | ||
(u'poleno.utils.template.TranslationLoader', u'django.template.loaders.app_directories.Loader')), | ||
TEMPLATE_DIRS=(self.tempdir.path,), | ||
) | ||
self.settings_override.enable() | ||
|
@@ -281,6 +283,7 @@ def tearDown(self): | |
self.settings_override.disable() | ||
self.tempdir.cleanup() | ||
|
||
|
||
def test_new_form(self): | ||
form = self.Form() | ||
rendered = self._render(u'{{ form }}', form=form) | ||
|
@@ -414,11 +417,18 @@ def test_empty_string_is_invalid(self): | |
validate_formatted_email(u'') | ||
|
||
def test_valid_values(self): | ||
validate_formatted_email(u'[email protected]') | ||
validate_formatted_email(u'John Smith <[email protected]>') | ||
validate_formatted_email(u'"John \\"Agent\\" Smith" <[email protected]>') | ||
validate_formatted_email(u'"Smith, John" <[email protected]>') | ||
validate_formatted_email(u'"[email protected]" <[email protected]>') | ||
validate_formatted_email(u'[email protected]') # // Parsed as: [email protected] | ||
validate_formatted_email(u'John Smith <[email protected]>') # // Parsed as: John Smith [email protected] | ||
validate_formatted_email(u'"John \\"Agent\\" Smith" <[email protected]>') # // Parsed as: John "Agent" Smith [email protected] | ||
validate_formatted_email(u'"Smith, John" <[email protected]>') # // Parsed as: Smith, John [email protected] | ||
validate_formatted_email(u'"[email protected]" <[email protected]>') # // Parsed as: [email protected] [email protected] | ||
validate_formatted_email(u'<[email protected]>') # // Parsed as: [email protected] | ||
validate_formatted_email(u'john [email protected]') # // Parsed as: [email protected] | ||
validate_formatted_email(u'"John" <[email protected]>') # // Parsed as: John [email protected] | ||
validate_formatted_email(u'"Smith, John" Agent <[email protected]>') # // Parsed as: Smith, John Agent [email protected] | ||
validate_formatted_email(u'[email protected] <[email protected]>') # // Parsed as: [email protected] | ||
validate_formatted_email(u'[email protected],') # // Parsed as: [email protected] | ||
validate_formatted_email(u'John Smith <[email protected]>, [email protected]') # // Parsed as: John Smith [email protected] | ||
|
||
def test_invalid_values(self): | ||
with self.assertRaisesMessage(ValidationError, u'"invalid" is not a valid email address'): | ||
|
@@ -441,11 +451,17 @@ def test_empty_string_is_valid(self): | |
validate_comma_separated_emails(u'') | ||
|
||
def test_valid_values(self): | ||
validate_comma_separated_emails(u'[email protected]') | ||
validate_comma_separated_emails(u'John Smith <[email protected]>, [email protected]') | ||
validate_comma_separated_emails(u'"John \\"Agent\\" Smith" <[email protected]>') | ||
validate_comma_separated_emails(u'"Smith, John" <[email protected]>') | ||
validate_comma_separated_emails(u'"[email protected]" <[email protected]>') | ||
validate_comma_separated_emails(u'[email protected]') # // Parsed as [email protected] | ||
validate_comma_separated_emails(u'John Smith <[email protected]>, [email protected]') # // Parsed as John Smith [email protected]; [email protected] | ||
validate_comma_separated_emails(u'"John \\"Agent\\" Smith" <[email protected]>') # // Parsed as: John "Agent" Smith [email protected] | ||
validate_comma_separated_emails(u'"Smith, John" <[email protected]>') # // Parsed as: Smith, John [email protected] | ||
validate_comma_separated_emails(u'"[email protected]" <[email protected]>') # // Parsed as: [email protected] [email protected] | ||
validate_comma_separated_emails(u'<[email protected]>') # // Parsed as: [email protected] | ||
validate_comma_separated_emails(u'john [email protected]') # // Parsed as: [email protected] | ||
validate_comma_separated_emails(u'"John" <[email protected]>') # // Parsed as: John [email protected] | ||
validate_comma_separated_emails(u'"Smith, John" Agent <[email protected]>') # // Parsed as: Smith, John Agent [email protected] | ||
validate_comma_separated_emails(u'[email protected] <[email protected]>') # // Parsed as: [email protected]; [email protected] | ||
validate_comma_separated_emails(u'[email protected],') # // Parsed as: [email protected] | ||
|
||
def test_invalid_values(self): | ||
with self.assertRaisesMessage(ValidationError, u'"invalid" is not a valid email address'): | ||
|
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