summaryrefslogtreecommitdiff
path: root/Mailman/tests/test_documentation.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-11-04 18:10:21 -0500
committerBarry Warsaw2007-11-04 18:10:21 -0500
commit46f480dfaa6286ff8950af817de1c35910b37e16 (patch)
tree194e8a3fb2150b7fa9ce5063a4b5b4acdf821365 /Mailman/tests/test_documentation.py
parent85473d738ce8ec53ac518819832e0babc3558cf2 (diff)
downloadmailman-46f480dfaa6286ff8950af817de1c35910b37e16.tar.gz
mailman-46f480dfaa6286ff8950af817de1c35910b37e16.tar.zst
mailman-46f480dfaa6286ff8950af817de1c35910b37e16.zip
Target Mailman onto the Storm <http://storm.canonical.com> Python ORM. This
enables a few interesting things: 1. It makes it easier to do our "pillars of storage" idea, where list data and messages could live in one database, but user information live in a separate database. 2. It reduces the number of moving parts. SQLAlchemy and Elixir can both go away in favor of just one database layer. 3. No more Unicode/string mush hell. Somewhere along the way the upgrade to SQLAlchemy 0.4 and Elixir 0.4 made the strings coming out the database sometimes Unicode and sometimes 8-bit. This was totally unpredictable. Storm asserts that if a property is declared Unicode, it comes in and goes out as Unicode. 4. 'flush' is gone. One cost of this is that Storm does not yet currently support schema generation. So I cheat by dumping the trunk's SQLite schema and using that as a starting place for the Storm-based schema. I hope that Storm will eventually address this. Other related changes include: - SQLALCHEMY_ENGINE_URL is renamed to DEFAULT_DATABASE_URL. This may still get changed. Things I still want to fix: - Ickyness with clearing the databases. - Really implement multiple stores with better management of the Store instances. - Fix all the circular import nasties.
Diffstat (limited to 'Mailman/tests/test_documentation.py')
-rw-r--r--Mailman/tests/test_documentation.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Mailman/tests/test_documentation.py b/Mailman/tests/test_documentation.py
index d8578bd05..c6ba0a1d6 100644
--- a/Mailman/tests/test_documentation.py
+++ b/Mailman/tests/test_documentation.py
@@ -22,8 +22,11 @@ import pdb
import doctest
import unittest
+from email import message_from_string
+
import Mailman
+from Mailman.Message import Message
from Mailman.app.styles import style_manager
from Mailman.configuration import config
from Mailman.database import flush
@@ -33,6 +36,17 @@ COMMASPACE = ', '
+def specialized_message_from_string(string):
+ return message_from_string(string, Message)
+
+
+def setup(testobj):
+ """Set up some things for convenience."""
+ testobj.globs['config'] = config
+ testobj.globs['message_from_string'] = specialized_message_from_string
+
+
+
def cleaning_teardown(testobj):
"""Clear all persistent data at the end of a doctest."""
# Clear the database of all rows.
@@ -69,6 +83,7 @@ def test_suite():
'docs/' + filename,
package=Mailman,
optionflags=flags,
+ setUp=setup,
tearDown=cleaning_teardown)
suite.addTest(test)
return suite