One thing to watch with Postgresql databases in testing is,
autoincrement primary keys do *not* roll back. So on the first test
run the new records may start with 1, but on later runs they may start
with 10,000 or some other absurdly high number, even though the
insertions are always rolled back
On Thu, Jun 24, 2021 at 10:34 AM Zsolt Ero wrote:
>
> Hi,
>
> I have my webtest based testing set up like the following.
>
> @pytest.fixture(scope="session")
> def app():
> testing_config = {
> 'sqlalchemy.url': 'postgresql+psycopg2://x@/x',
> 'redis.sessions.secret': 'x', #
If you have the app, the registry is attached as "app.registry" and you can use
the underlying prepare() method with it, same as bootstrap does. See
https://docs.pylonsproject.org/projects/pyramid/en/latest/api/scripting.html#pyramid.scripting.prepare
Hi,
I have my webtest based testing set up like the following.
@pytest.fixture(scope="session")
def app():
testing_config = {
'sqlalchemy.url': 'postgresql+psycopg2://x@/x',
'redis.sessions.secret': 'x', # random string
'redis.sessions.db': 1,