Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
except ImportError: from StringIO import StringIO
FileOrURLField, MutuallyExclusiveRadioWidget, MutuallyExclusiveValueField, FileOrURLWidget, )
fields=(forms.IntegerField(), forms.IntegerField()), widget=MutuallyExclusiveRadioWidget(widgets=[ forms.Select(choices=[(1, 1), (2, 2)]), forms.TextInput(attrs={'placeholder': 'Enter a number'}), ]))
{'test_field': [forms.Field.default_error_messages['required']]})
{'test_field': [MutuallyExclusiveValueField.too_many_values_error]})
required=False, fields=(forms.IntegerField(), forms.IntegerField()), widget=MutuallyExclusiveRadioWidget(widgets=[ forms.Select(choices=[(1, 1), (2, 2)]), forms.TextInput(attrs={'placeholder': 'Enter a number'}), ]))
StringIO(' '), None, 'file', 'text/plain', 1, None)
{'test_field': [forms.Field.default_error_messages['required']]})
{'test_field_1': self.test_url}, {'test_field_0': self.test_file}, ) {'test_field': [MutuallyExclusiveValueField.too_many_values_error]})
FileOrURLTestCaseBase): 'test_field_1': self.test_url, })
'test_field_0': self.test_file, })
FileOrURLTestCaseBase): no_aws_qs=True)
'test_field_1': self.test_url, })
'test_field_0': self.test_file, }) form.cleaned_data['test_field'], urljoin(settings.MEDIA_URL, 'TEST/file'))
FileOrURLTestCaseBase):
'test_field_0': self.test_file, })
def test_validate_url(self, mock_get): form.cleaned_data['test_field'].read(), self.test_resp)
def test_validate_bad_url(self, mock_get):
def test_validate_bad_request(self, mock_get): raise Exception
forms.Select(choices=[(1, 1), (2, 2)]), forms.TextInput(attrs={'placeholder': 'Enter a number'}), ]) w.render('test', None), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<select name="test_0"><option value="1">1</option>' '<option value="2">2</option></select></span><br>' '<span><input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter a number" type="text" />' '</span></span>') w.render('test', ''), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<select name="test_0"><option value="1">1</option>' '<option value="2">2</option></select></span><br>' '<span><input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter a number" type="text" />' '</span></span>') w.render('test', '1'), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<select name="test_0"><option value="1">1</option>' '<option value="2">2</option></select></span><br>' '<span><input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter a number" type="text" />' '</span></span>') w.render('test', ['1', None]), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<select name="test_0"><option value="1" selected="selected">1' '</option><option value="2">2</option></select></span><br>' '<span><input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter a number" type="text" />' '</span></span>') w.render('test', [None, '1']), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input name="test_radio" type="radio" />' '<select name="test_0"><option value="1">1</option>' '<option value="2">2</option></select></span><br><span>' '<input checked="" name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter a number" type="text" ' 'value="1" /></span></span>')
StringIO(' '), None, 'file', 'text/plain', 1, None)
w.render('test', None), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<input name="test_0" type="file" /></span><br><span>' '<input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter URL" type="url" />' '</span></span>') w.render('test', ''), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<input name="test_0" type="file" /></span><br><span>' '<input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter URL" type="url" />' '</span></span>') w.render('test', self.test_file), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<input name="test_0" type="file" /></span><br><span>' '<input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter URL" type="url" />' '</span></span>') w.render('test', 'http://example.com'), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input name="test_radio" type="radio" />' '<input name="test_0" type="file" /></span><br><span>' '<input checked="" name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter URL" type="url" ' 'value="http://example.com"/>' '</span></span>') w.render('test', [None, 'http://example.com']), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input name="test_radio" type="radio" />' '<input name="test_0" type="file" /></span><br><span>' '<input checked="" name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter URL" type="url" ' 'value="http://example.com" />' '</span></span>') w.render('test', []), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<input name="test_0" type="file" /></span><br><span>' '<input name="test_radio" type="radio" />' '<input name="test_1" placeholder="Enter URL" type="url" />' '</span></span>')
w.render('test', None), '<span id="test_container" class="mutually-exclusive-widget" ' 'style="display:inline-block">' '<span><input checked="" name="test_radio" type="radio" />' '<input id="test_0" name="test_0" type="file" /></span><br><span>' '<input name="test_radio" type="radio" />' '<input id="test_1" name="test_1" placeholder="Enter URL" ' 'type="url" /></span></span>')
|