Extend the test method with the provided code.
Note, once again, the batch_mode parameter that we will need to add later to DiscussionThreadModule_addReply script.
"transaction" is a module, that is why we added an "import transaction" at the top of the Test file.
"transaction.commit" saves the created objects in the Database.
As a guideline, it's a bad habit to commit after each operation: in a production environment, we try to group operations to reduce as much as possible database contention.
self.tic is a clock “tick”. It forces background activities to run.
As a guideline, it's a bad habit to force your test to tic unless needed. Activities run when the system load is low, asynchronously. Inserting systematic tics after each operation in a Test eliminates the asynchronous character of activities.
Here, for example we use the commit+tic stance only because the next lines will perform a Catalog search (A SQL search, in fact). And we need to ensure that data has been committed before doing this search, otherwise new objects will not show up.