The response being a 302 redirect is normal, that's what happens after a form submit, it redirects back to the wiki page. You can do `r = r.follow()` if you want to continue to the page.
I wouldn't patch `send_user_mention_notification` though. We want that to run, and then make assertions about what emails it would send out. You probably will need to use `M.MonQTask.run_ready()` which will make all background tasks run right there in the test. So when send_user_mention_notification.post() is called it'll go into a background task, and then run_ready will make it run. And then you can assert that sendsimplemail was called with the right values (either by patching it, or by checking for _its_ tasks with something like `mailtasks = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendsimplemail')).all()`) --- ** [tickets:#8323] gsoc19 - Trigger notification task per each artifact creation/modification and add tests** **Status:** review **Milestone:** unreleased **Labels:** gsoc19 **Created:** Mon Aug 12, 2019 04:50 PM UTC by Shalitha Suranga **Last Updated:** Sat Aug 24, 2019 05:12 PM UTC **Owner:** Shalitha Suranga Add a test for the send_usermentions_notification task. Also.. `send_usermentions_notification` task is only called in a few places so far, but would be good to do in all the places where a new artifact is created/modified(content) (new wiki page, new ticket, new blog post, new merge request). Maybe a new ticket for all that together. --- Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/ To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.