summaryrefslogtreecommitdiff
path: root/src/mailman/database/tests/test_factory.py
diff options
context:
space:
mode:
authorBarry Warsaw2014-11-29 12:46:49 -0500
committerBarry Warsaw2014-11-29 12:46:49 -0500
commit59110812266f4b1b3c73a6fb29fbb99da2dc31c3 (patch)
tree8f2ea133541479201c2927653232891e22080e49 /src/mailman/database/tests/test_factory.py
parenta803d3047f777fcc067403833993e0dd3f031b9c (diff)
downloadmailman-59110812266f4b1b3c73a6fb29fbb99da2dc31c3.tar.gz
mailman-59110812266f4b1b3c73a6fb29fbb99da2dc31c3.tar.zst
mailman-59110812266f4b1b3c73a6fb29fbb99da2dc31c3.zip
Diffstat (limited to 'src/mailman/database/tests/test_factory.py')
-rw-r--r--src/mailman/database/tests/test_factory.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mailman/database/tests/test_factory.py b/src/mailman/database/tests/test_factory.py
index c84458db2..29cca41ba 100644
--- a/src/mailman/database/tests/test_factory.py
+++ b/src/mailman/database/tests/test_factory.py
@@ -119,12 +119,16 @@ class TestSchemaManager(unittest.TestCase):
# No existing database.
self.assertFalse(self._table_exists('mailinglist'))
self.assertFalse(self._table_exists('alembic_version'))
+ # For the initial setup of the database, the upgrade command will not
+ # be called. The tables will be created and then the schema stamped
+ # at Alembic's latest revision.
head_rev = self.schema_mgr.setup_database()
self.assertFalse(alembic_command_upgrade.called)
self.assertTrue(self._table_exists('mailinglist'))
+ self.assertTrue(self._table_exists('alembic_version'))
+ # The current Alembic revision is the same as the initial revision.
md = MetaData()
md.reflect(bind=config.db.engine)
- self.assertIn('alembic_version', md.tables)
current_rev = config.db.engine.execute(
md.tables['alembic_version'].select()).scalar()
self.assertEqual(current_rev, head_rev)