summaryrefslogtreecommitdiff
path: root/src/mailman/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/testing')
-rw-r--r--src/mailman/testing/layers.py7
-rw-r--r--src/mailman/testing/testing.cfg6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py
index eb51e309f..006feef9c 100644
--- a/src/mailman/testing/layers.py
+++ b/src/mailman/testing/layers.py
@@ -190,6 +190,13 @@ class ConfigLayer(MockAndMonkeyLayer):
@classmethod
def tearDown(cls):
assert cls.var_dir is not None, 'Layer not set up'
+ reset_the_world()
+ # Destroy the test database after the tests are done so that there is
+ # no data in case the tests are rerun with a database layer like mysql
+ # or postgresql which are not deleted in teardown.
+ #
+ # XXX 2014-11-01 BAW: Shouldn't reset_the_world() take care of this?
+ config.db.destroy()
config.pop('test config')
shutil.rmtree(cls.var_dir)
cls.var_dir = None
diff --git a/src/mailman/testing/testing.cfg b/src/mailman/testing/testing.cfg
index fc76aa361..12646c680 100644
--- a/src/mailman/testing/testing.cfg
+++ b/src/mailman/testing/testing.cfg
@@ -18,9 +18,9 @@
# A testing configuration.
# For testing against PostgreSQL.
-# [database]
-# class: mailman.database.postgresql.PostgreSQLDatabase
-# url: postgres://barry:barry@localhost/mailman
+[database]
+class: mailman.database.postgresql.PostgreSQLDatabase
+url: postgresql://barry:barry@localhost:5432/mailman
[mailman]
site_owner: noreply@example.com