Now that we have the means to access the database, and the full power of SQLAlchemy at our fingertips, implementing the utilities that perform database operations is easy.
Of course, we should start with the tests. We have opted to use a doctest to demonstrate the database interaction pattern, found in
tests/database.txt, and invoked with the following lines in
ztc.ZopeDocFileSuite( 'tests/database.txt', package='optilux.cinemacontent', test_class=base.CinemaContentFunctionalTestCase, optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
These tests create some sample content, populate a few records in the database, and then exercise the ...