This test case creates a remote PostreSQL database provided by postgression.com. postgression.com provides you with a PostgreSQL database, so you don't need to set up a PostgreSQL server on your local machine.
Unfortunately, PostgreSQL only provides you with 100 Database per hour, which can be reached very quickly when running lots of tests at the same time. This is where this DatabaseTestCase comes into place. It stores information about the last database used on your machine and reuses it so you won't reach the limit of 100 database.
Just copy the TestCase class somewhere in your tests folder. Then import the class. Let's say you have a file called setupTests.py
in the test folder, the you would have to write:
from .setupTests import DatabaseTestCase
class MyTests(DatabaseTestCase):