| Conditions | 4 |
| Total Lines | 15 |
| Lines | 15 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from django.test import TestCase |
||
| 10 | View Code Duplication | @staticmethod |
|
| 11 | def test_get_context(): |
||
| 12 | """Tests whether the :see:get_context correctly |
||
| 13 | handles 'required' attribute, separately for each subwidget.""" |
||
| 14 | |||
| 15 | widget = LocalizedFileWidget() |
||
| 16 | widget.widgets[0].is_required = True |
||
| 17 | widget.widgets[1].is_required = True |
||
| 18 | widget.widgets[2].is_required = False |
||
| 19 | context = widget.get_context(name='test', |
||
| 20 | value=LocalizedFileValue(dict(en='test')), |
||
| 21 | attrs=dict(required=True)) |
||
| 22 | assert 'required' not in context['widget']['subwidgets'][0]['attrs'] |
||
| 23 | assert context['widget']['subwidgets'][1]['attrs']['required'] |
||
| 24 | assert 'required' not in context['widget']['subwidgets'][2]['attrs'] |
||
| 25 |
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.