def test_edit_resource(self): """ Edit this resource successfully. """ params = { 'label': 'signup', 'email': '*****@*****.**', 'question': 'Cool.', 'status': 'open', } issue = Issue(**params) issue.save() params_edit = { 'label': 'other', 'email': '*****@*****.**', 'question': 'Cool.', 'status': 'closed', } self.login() response = self.client.post(url_for('admin.issues_edit', id=issue.id), data=params_edit, follow_redirects=True) assert_status_with_message(200, response, _('Issue has been saved successfully.'))
def support(): # Pre-populate the email field if the user is signed in. form = SupportForm(obj=current_user) if form.validate_on_submit(): i = Issue() form.populate_obj(i) i.save() # This prevents circular imports. from catwatch.blueprints.issue.tasks import deliver_support_email deliver_support_email.delay(i.id) flash(_('Help is on the way, expect a response shortly.'), 'success') return redirect(url_for('issue.support')) return render_template('issue/support.jinja2', form=form)