0001-misc-do-not-crash-form-inspect-on-invalid-data-sourc.patch
tests/admin_pages/test_form.py | ||
---|---|---|
3557 | 3557 |
id='12', label='file', automatic_image_resize=True, display_locations=['validation'] |
3558 | 3558 |
), |
3559 | 3559 |
fields.BlockField(id='13', label='Block field', type='block:foobar'), |
3560 |
fields.ItemField( |
|
3561 |
id='14', label='Item field invalid data source', type='item', data_source={'type': 'xxx'} |
|
3562 |
), |
|
3560 | 3563 |
] |
3561 | 3564 |
formdef.workflow_options = {'test': 'plop'} |
3562 | 3565 |
formdef.store() |
... | ... | |
3633 | 3636 |
assert resp.pyquery('[data-field-id="13"] h4 .inspect-field-type a').attr.href.endswith( |
3634 | 3637 |
block.get_admin_url() + 'inspect' |
3635 | 3638 |
) |
3639 |
assert resp.pyquery('[data-field-id="14"] .parameter-data_source a').attr['href'] == '#invalid-xxx' |
wcs/data_sources.py | ||
---|---|---|
1029 | 1029 |
def store(self): |
1030 | 1030 |
pass |
1031 | 1031 | |
1032 |
def get_admin_url(self): |
|
1033 |
return '#invalid-%s' % self.name |
|
1034 | ||
1032 | 1035 |
def __repr__(self): |
1033 | 1036 |
return '<StubNamedDataSource %r>' % self.name |
1034 | 1037 | |
1035 |
- |