Publish modules with plone.app.testing?

I'm currently finishing a rewrite of plone.namedfile (current work-in-progress branch).

I stumbled upon this method some tests that rely on this method from ZopeTestCase:

As some might be aware, thanks to @do3cc, we know that mixing plone.testing and ZopeTestCase is bad, bad, bad:

So I'm wondering what needs to be done to update a test that relies on this publish method... any ideas/code pointers?

This looks very much like a trick to avoid using a zope.testbrowser.
I did not look at all the tests in named file, but the ones I looked at seem to be quite straight forward replaceable with the zope.testbrowser browser.

I tried but it did not work at least for this test:

It does not matter that I leave the full URL, any attempt to render with a Browser that URL or parts of it returns a 404 Not Found.

So I guess the DummyContent being used is just too dummy? I didn't have time to dig deeper.

The code you linked is the old ZopeTestCase Version?

If you are using testbrowser, do not forget that the testbrowser sees what was committed already.
If you create content, you must commit it, else the views the testbrowser opens can't see it.

That's the old code.

Oh, committing, that nice trick... :smiley: I will give it a try and report back. Thanks again!

Plone Foundation Code of Conduct