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
aece8a2
commit d7c76fa
Showing
7 changed files
with
36 additions
and
85 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# vim: expandtab | ||
# -*- coding: utf-8 -*- | ||
import unittest | ||
from testfixtures import TempDirectory | ||
|
||
from django import forms | ||
|
@@ -13,6 +12,7 @@ | |
from poleno.utils.forms import (clean_button, AutoSuppressedSelect, CompositeTextField, | ||
PrefixedForm, validate_formatted_email, validate_comma_separated_emails) | ||
|
||
|
||
class CleanButtonTest(TestCase): | ||
u""" | ||
Tests ``clean_button()`` functions. Checks that valid button values are accepted and invalid or | ||
|
@@ -272,7 +272,6 @@ def _render(self, template, **context): | |
def setUp(self): | ||
self.tempdir = TempDirectory() | ||
self.settings_override = override_settings( | ||
TEMPLATE_LOADERS=(u'django.template.loaders.filesystem.Loader',), | ||
TEMPLATE_DIRS=(self.tempdir.path,), | ||
) | ||
self.settings_override.enable() | ||
|
@@ -282,14 +281,12 @@ def tearDown(self): | |
self.settings_override.disable() | ||
self.tempdir.cleanup() | ||
|
||
|
||
@unittest.skip(u'FIXME') | ||
def test_new_form(self): | ||
form = self.Form() | ||
rendered = self._render(u'{{ form }}', form=form) | ||
self.assertInHTML(u'<label for="id_composite_0">Composite:</label>', rendered) | ||
self.assertInHTML(u""" | ||
<div class="custom-class composite-text" custom-attribute="value"> | ||
<div class="custom-class pln-composite-text" custom-attribute="value"> | ||
(composite.txt) | ||
(aaa)(bbb) | ||
<input id="id_composite_0" name="composite_0" type="email"> | ||
|
@@ -364,7 +361,6 @@ def test_submitted_with_both_valid_values(self): | |
self.assertInHTML(u'<input id="id_composite_0" name="composite_0" type="email" value="[email protected]">', rendered) | ||
self.assertInHTML(u'<input id="id_composite_1" name="composite_1" type="number" value="47">', rendered) | ||
|
||
@unittest.skip(u'FIXME') | ||
def test_finalize(self): | ||
form = self.Form({u'composite_0': u'[email protected]', u'composite_1': u'47'}) | ||
self.assertTrue(form.is_valid()) | ||
|
@@ -436,23 +432,6 @@ def test_invalid_values(self): | |
with self.assertRaisesMessage(ValidationError, u'"" is not a valid email address'): | ||
validate_formatted_email(u',[email protected]') | ||
|
||
@unittest.skip(u'FIXME') | ||
def test_normalized_values(self): | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected]'): | ||
validate_formatted_email(u'<[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected]'): | ||
validate_formatted_email(u'invalid [email protected]') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: invalid <[email protected]>'): | ||
validate_formatted_email(u'"invalid" <[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: "aaa, bbb ccc" <[email protected]>'): | ||
validate_formatted_email(u'"aaa, bbb" ccc <[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected]'): | ||
validate_formatted_email(u'[email protected] <[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected]'): | ||
validate_formatted_email(u'[email protected],') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: John Smith <[email protected]>'): | ||
validate_formatted_email(u'John Smith <[email protected]>, [email protected]') | ||
|
||
class ValidateCommaSeparatedEmailsTest(TestCase): | ||
u""" | ||
Tests ``validate_comma_separated_emails()`` validator. | ||
|
@@ -479,18 +458,3 @@ def test_invalid_values(self): | |
validate_comma_separated_emails(u'Smith, John <[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'"" is not a valid email address'): | ||
validate_comma_separated_emails(u',[email protected]') | ||
|
||
@unittest.skip(u'FIXME') | ||
def test_normalized_values(self): | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected]'): | ||
validate_comma_separated_emails(u'<[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected]'): | ||
validate_comma_separated_emails(u'invalid [email protected]') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: invalid <[email protected]>'): | ||
validate_comma_separated_emails(u'"invalid" <[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: "aaa, bbb ccc" <[email protected]>'): | ||
validate_comma_separated_emails(u'"aaa, bbb" ccc <[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected], [email protected]'): | ||
validate_comma_separated_emails(u'[email protected] <[email protected]>') | ||
with self.assertRaisesMessage(ValidationError, u'Parsed as: [email protected]'): | ||
validate_comma_separated_emails(u'[email protected],') |
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