<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on Vic</title><link>https://vittoriocamisa.dev/post/</link><description>Recent content in Posts on Vic</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Fri, 17 Mar 2017 00:00:00 +0200</lastBuildDate><atom:link href="https://vittoriocamisa.dev/post/index.xml" rel="self" type="application/rss+xml"/><item><title>Agile database integration tests with Python, SQLAlchemy and Factory Boy</title><link>https://vittoriocamisa.dev/blog/agile-database-integration-tests-with-python-sqlalchemy-and-factory-boy/</link><pubDate>Fri, 17 Mar 2017 00:00:00 +0200</pubDate><guid>https://vittoriocamisa.dev/blog/agile-database-integration-tests-with-python-sqlalchemy-and-factory-boy/</guid><description>xkcd
So you are interested in testing, aren’t you?
Not doing it yet? That’s the right time to start then!
In this little example, I’m going to show a possible procedure to easily test your piece of code that interacts with a database.
Doing database integration tests, you will generally need few things for each test case:
Setup test data in one or more tables (setup) Run the under-test functionality Check actual state on database is as expected (assertions) Clear all for the next test (teardown) If not done carefully, most of these steps could bring more-than-wanted lines of code.</description></item></channel></rss>