diff options
| author | Tim Graham <timograham@gmail.com> | 2013-09-03 14:22:21 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-09-03 14:22:21 -0400 |
| commit | 5649c0af9d90ba1368abbe6c233ee61c976c8137 (patch) | |
| tree | 78df445094924d3ed21a236c694c503d3cc723f3 /tests/forms_tests | |
| parent | cb98ffe8f45d77a7e892fbb80b47de999062dc74 (diff) | |
Fixed "indentation is not a multiple of four" pep8 issues.
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/tests/test_forms.py | 6 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_formsets.py | 8 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_widgets.py | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index 06ee3212a9..168bc1de6a 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -1173,9 +1173,9 @@ class FormsTestCase(TestCase): # If a Form defines 'initial' *and* 'initial' is passed as a parameter to Form(), # then the latter will get precedence. class UserRegistration(Form): - username = CharField(max_length=10, initial=initial_django) - password = CharField(widget=PasswordInput) - options = MultipleChoiceField(choices=[('f','foo'),('b','bar'),('w','whiz')], initial=initial_other_options) + username = CharField(max_length=10, initial=initial_django) + password = CharField(widget=PasswordInput) + options = MultipleChoiceField(choices=[('f','foo'),('b','bar'),('w','whiz')], initial=initial_other_options) p = UserRegistration(auto_id=False) self.assertHTMLEqual(p.as_ul(), """<li>Username: <input type="text" name="username" value="django" maxlength="10" /></li> diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py index 6372f2a8f4..bd34babef6 100644 --- a/tests/forms_tests/tests/test_formsets.py +++ b/tests/forms_tests/tests/test_formsets.py @@ -91,7 +91,7 @@ class FormsFormsetTestCase(TestCase): # for adding data. By default, it displays 1 blank form. It can display more, # but we'll look at how to do so later. formset = self.make_choiceformset() - + self.assertHTMLEqual(str(formset), """<input type="hidden" name="choices-TOTAL_FORMS" value="1" /><input type="hidden" name="choices-INITIAL_FORMS" value="0" /><input type="hidden" name="choices-MAX_NUM_FORMS" value="1000" /> <tr><th>Choice:</th><td><input type="text" name="choices-0-choice" /></td></tr> <tr><th>Votes:</th><td><input type="number" name="choices-0-votes" /></td></tr>""") @@ -366,7 +366,7 @@ class FormsFormsetTestCase(TestCase): # it's going to be deleted. class CheckForm(Form): - field = IntegerField(min_value=100) + field = IntegerField(min_value=100) data = { 'check-TOTAL_FORMS': '3', # the number of forms rendered @@ -978,7 +978,7 @@ class FormsFormsetTestCase(TestCase): def test_validate_max_ignores_forms_marked_for_deletion(self): class CheckForm(Form): - field = IntegerField() + field = IntegerField() data = { 'check-TOTAL_FORMS': '2', @@ -1004,7 +1004,7 @@ class FormsFormsetTestCase(TestCase): ([('Calexico', '100'), ('Calexico', '')], 1), ([('Calexico', ''), ('Calexico', '')], 2), ] - + for formset_data, expected_error_count in data: formset = self.make_choiceformset(formset_data) self.assertEqual(formset.total_error_count(), expected_error_count) diff --git a/tests/forms_tests/tests/test_widgets.py b/tests/forms_tests/tests/test_widgets.py index 7f23b1a8b5..033bc7a035 100644 --- a/tests/forms_tests/tests/test_widgets.py +++ b/tests/forms_tests/tests/test_widgets.py @@ -639,8 +639,8 @@ beatle J R Ringo False""") # You can create your own custom renderers for RadioSelect to use. class MyRenderer(RadioFieldRenderer): - def render(self): - return '<br />\n'.join(six.text_type(choice) for choice in self) + def render(self): + return '<br />\n'.join(six.text_type(choice) for choice in self) w = RadioSelect(renderer=MyRenderer) self.assertHTMLEqual(w.render('beatle', 'G', choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo'))), """<label><input type="radio" name="beatle" value="J" /> John</label><br /> <label><input type="radio" name="beatle" value="P" /> Paul</label><br /> @@ -649,7 +649,7 @@ beatle J R Ringo False""") # Or you can use custom RadioSelect fields that use your custom renderer. class CustomRadioSelect(RadioSelect): - renderer = MyRenderer + renderer = MyRenderer w = CustomRadioSelect() self.assertHTMLEqual(w.render('beatle', 'G', choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo'))), """<label><input type="radio" name="beatle" value="J" /> John</label><br /> <label><input type="radio" name="beatle" value="P" /> Paul</label><br /> |
