On Tuesday, January 24, 2017 at 4:50:55 PM UTC-5, Steve Piercy wrote: > > Take a look at this step in the SQLAlchemy + URL Dispatch wiki tutorial. > > http://docs.pylonsproject.org/projects/pyramid/en/latest/tutorials/wiki2/tests.html >
+1 for that tutorial. one of the projects we opensourced used that as inspiration. a general pattern I used for those type of tests is: 1. insert objects into database via http tests 2. check objects exist in database via raw sqlalchemy in terms of datastores, I suggest using a different connection string for sqalalchemy -- test against a testdb (i would not test against sqlite if you're deploying on postgres/mysql as things can differ slightly) at some point your functional tests will work better as part of integrated tests... at that point, i like using the `requests` library to work like a headless browser. beautfifulsoup can help ensure you have the right content on the page. it can take a little longer to write, but I found that `requests` worked significantly faster than selenium (as in "seconds instead of minutes", and one 26+ minute selenium test dropped to around 90 seconds when it was rewritten to requests.) -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/9cdded60-72af-4345-81b3-b5bfdf47c250%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
