def test_form_rows_fields_exists(self):
        """
            Check model fields appear in action form for each selected models
        """
        with user_grant_permission(self.user, [
                'demo.change_demomodel',
                'demo.adminactions_byrowsupdate_demomodel'
        ]):
            res = self._get_changelist_form_response()

            form = res.forms['changelist-form']
            self._select_rows(form, selected_rows=self._selected_rows)
            res = self._get_action_form_response(change_list_response=res)
            byrows_update_get_fields(ModelAdmin(DemoModel, self.site))
            for r, value in enumerate(self._selected_values):
                for fname in byrows_update_get_fields(
                        ModelAdmin(DemoModel, self.site)):
                    fname = 'form-%d-%s' % (r, fname)

                    try:
                        # Attempt split (admin datetime widget) fields first
                        assert res.form[fname + '_0']
                    except AssertionError:
                        # assert for non-split fields to return the regular
                        # field name upon errors
                        assert res.form[fname]
    def test_form_rows_fields_exists(self):
        """
            Check model fields appear in action form for each selected models
        """
        with user_grant_permission(self.user, ['demo.change_demomodel', 'demo.adminactions_byrowsupdate_demomodel']):
            res = self._get_changelist_form_response()

            form = res.forms['changelist-form']
            self._select_rows(form, selected_rows=self._selected_rows)
            res = self._get_action_form_response(change_list_response=res)
            byrows_update_get_fields(ModelAdmin(DemoModel, self.site))
            for r, value in enumerate(self._selected_values):
                for fname in byrows_update_get_fields(ModelAdmin(DemoModel, self.site)):
                    assert res.form["form-%d-%s" % (r, fname)]
    def test_form_rows_fields_exists(self):
        """
            Check model fields appear in action form for each selected models
        """
        with user_grant_permission(self.user, [
                'demo.change_demomodel',
                'demo.adminactions_byrowsupdate_demomodel'
        ]):
            res = self._get_changelist_form_response()

            form = res.forms['changelist-form']
            self._select_rows(form, selected_rows=self._selected_rows)
            res = self._get_action_form_response(change_list_response=res)
            byrows_update_get_fields(ModelAdmin(DemoModel, self.site))
            for r, value in enumerate(self._selected_values):
                for fname in byrows_update_get_fields(
                        ModelAdmin(DemoModel, self.site)):
                    assert res.form["form-%d-%s" % (r, fname)]