File tree Expand file tree Collapse file tree 3 files changed +23
-23
lines changed Expand file tree Collapse file tree 3 files changed +23
-23
lines changed Original file line number Diff line number Diff line change 1- VERSION = "0.2.18 "
1+ VERSION = "0.2.19 "
Original file line number Diff line number Diff line change @@ -132,16 +132,17 @@ <h6 class="m-0 text-primary font-weight-bold">
132132 < div class ="col-6 ">
133133 {% for permission in category.optional %}
134134 < div class ="d-flex align-items-center ">
135- < span > {{ permission.name }}</ span >
136-
135+ < label for =" permission-{{ permission.id }} " > {{ permission.name }}</ label >
136+
137137 {% if permission.short_description %}
138138 < i class ="ml-2 fas fa-info-circle text-gray-600 " aria-label ="{% trans 'Info' %} "> </ i >
139139 {% endif %}
140- < input
141- class ="ml-auto "
142- type ="checkbox "
143- name ="{{ form.permissions.name }} "
140+ < input
141+ class ="ml-auto "
142+ type ="checkbox "
143+ name ="{{ form.permissions.name }} "
144144 value ="{{ permission.id }} "
145+ id ="permission-{{ permission.id }} "
145146 {% if permission.selected %} checked{% endif %}
146147 >
147148 </ div >
@@ -170,5 +171,4 @@ <h6 class="m-0 text-primary font-weight-bold">
170171 } )
171172 </ script >
172173 {% endif %}
173- {% endblock %}
174-
174+ {% endblock %}
Original file line number Diff line number Diff line change @@ -469,20 +469,20 @@ def test_update_form_has_selected_optional_permission(self):
469469 uri = reverse ('permafrost:role-update' , kwargs = {'slug' : 'test-role' })
470470 response = self .client .get (uri )
471471 try :
472- self .assertContains (response , """<input
473- class="ml-auto"
474- type="checkbox"
475- name="permissions"
476- value="37"
477- checked
478- >""" )
479- self . assertContains ( response , """<input
480- class="ml-auto"
481- type="checkbox"
482- name="permissions"
483- value=" 38"
484- checked
485- >""" )
472+ self .assertTrue (response . context [ 'permission_categories' ][ 'permafrostrole' ][ 'optional' ][ 0 ]. selected )
473+ self . assertTrue ( response . context [ 'permission_categories' ][ 'permafrostrole' ][ 'optional' ][ 1 ]. selected )
474+ self . assertEqual ( response . context [ 'permission_categories' ][ 'permafrostrole' ][ 'optional' ][ 0 ]. id , 37 )
475+ self . assertEqual ( response . context [ 'permission_categories' ][ 'permafrostrole' ][ 'optional' ][ 1 ]. id , 38 )
476+ self . assertEqual ( response . context [ 'permission_categories' ][ 'permafrostrole' ][ 'optional' ][ 0 ]. name ,
477+ 'Can add Role' )
478+ self . assertEqual ( response . context [ 'permission_categories' ][ 'permafrostrole' ][ 'optional' ][ 1 ]. name ,
479+ 'Can change Role' )
480+ self . assertContains ( response , 'value="37"' )
481+ self . assertContains ( response , 'value="38"' )
482+ self . assertContains ( response , 'id="permission-37"' )
483+ self . assertContains ( response , 'id="permission- 38"' )
484+ self . assertContains ( response , ' checked' )
485+
486486 except :
487487 print ("" )
488488 print (response .content .decode ())
You can’t perform that action at this time.
0 commit comments