summaryrefslogtreecommitdiff
path: root/src/mailman/database/tests/test_migrations.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-12-30 14:39:10 -0500
committerBarry Warsaw2012-12-30 14:39:10 -0500
commita0244a524117c90cbf22f0007b96933c4fb2aa4b (patch)
tree21fc100ba690971aa1310fb08c82fedc5f38084c /src/mailman/database/tests/test_migrations.py
parent2450a9c9642d06af1a60df70acb742e67959d77e (diff)
parent5ec8a131c602f9b00d6b25d914ffc923cd1aa964 (diff)
downloadmailman-a0244a524117c90cbf22f0007b96933c4fb2aa4b.tar.gz
mailman-a0244a524117c90cbf22f0007b96933c4fb2aa4b.tar.zst
mailman-a0244a524117c90cbf22f0007b96933c4fb2aa4b.zip
* List styles are supported through the REST API. Get the list of available
styles (by name) via `.../lists/styles`. Create a list in a specific style by using POST data `style_name=<style>`. (LP: #975692) * The default list style is renamed to `legacy-default` and a new `legacy-announce` style is added. This is similar to the `legacy-default` except set up for announce-only lists. * The following columns were unused and have been removed: - `mailinglist.new_member_options` - `mailinglist.send_reminders` - `mailinglist.subscribe_policy` - `mailinglist.unsubscribe_policy` - `mailinglist.subscribe_auto_approval` - `mailinglist.private_roster` - `mailinglist.admin_member_chunksize` Also: * List styles no longer have a priority, nor is there any style matching any more. Now, exactly one named style (either explicitly through the `create_list()` function, or by default from the configuration file) is applied to a list at list creation time. * The huge old DefaultStyle is now decomposed into smaller units. An announce-like style is added. * `find_components()` and `scan_module()` moved from `app/finder.py` to `utilities/modules.py`. * Lots of doctest rewriting for better documentation. Bad-path tests moved to unittests. * `create_list()` now takes an optional `style_name` parameter. If not given, `[styles]default` is used. * `create_list()` doesn't set the `personalize` or `display_name` attributes any more. These are already set in styles. * Removed an unnecessary `tearDown()`. * Added some improvements on displaying lists in JSON responses.
Diffstat (limited to 'src/mailman/database/tests/test_migrations.py')
-rw-r--r--src/mailman/database/tests/test_migrations.py31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/mailman/database/tests/test_migrations.py b/src/mailman/database/tests/test_migrations.py
index 4401b030f..4b784d8b3 100644
--- a/src/mailman/database/tests/test_migrations.py
+++ b/src/mailman/database/tests/test_migrations.py
@@ -24,6 +24,8 @@ __all__ = [
'TestMigration20120407MigratedData',
'TestMigration20120407Schema',
'TestMigration20120407UnchangedData',
+ 'TestMigration20121015MigratedData',
+ 'TestMigration20121015Schema',
]
@@ -151,8 +153,10 @@ class TestMigration20120407UnchangedData(MigrationTestBase):
'mailman.database.tests.data',
'migration_{0}_1.sql'.format(self._database.TAG))
self._database.load_sql(self._database.store, sample_data)
- # Update to the current migration we're testing.
- self._database.load_migrations('20120407000000')
+ # XXX 2012-12-28: We have to load the last migration defined in the
+ # system, otherwise the ORM model will not match the SQL table
+ # definitions and we'll get OperationalErrors from SQLite.
+ self._database.load_migrations('20121015000000')
def test_migration_domains(self):
# Test that the domains table, which isn't touched, doesn't change.
@@ -216,8 +220,10 @@ class TestMigration20120407MigratedData(MigrationTestBase):
self._database.load_sql(self._database.store, sample_data)
def _upgrade(self):
- # Update to the current migration we're testing.
- self._database.load_migrations('20120407000000')
+ # XXX 2012-12-28: We have to load the last migration defined in the
+ # system, otherwise the ORM model will not match the SQL table
+ # definitions and we'll get OperationalErrors from SQLite.
+ self._database.load_migrations('20121015000000')
def test_migration_archive_policy_never_0(self):
# Test that the new archive_policy value is updated correctly. In the
@@ -369,6 +375,14 @@ class TestMigration20121015Schema(MigrationTestBase):
['20121014999999'],
('list_id',),
('mailing_list',))
+ self._missing_present('mailinglist',
+ ['20121014999999'],
+ (),
+ ('new_member_options', 'send_reminders',
+ 'subscribe_policy', 'unsubscribe_policy',
+ 'subscribe_auto_approval', 'private_roster',
+ 'admin_member_chunksize'),
+ )
def test_post_upgrade_column_migrations(self):
self._missing_present('ban',
@@ -376,8 +390,17 @@ class TestMigration20121015Schema(MigrationTestBase):
'20121015000000'],
('mailing_list',),
('list_id',))
+ self._missing_present('mailinglist',
+ ['20121014999999',
+ '20121015000000'],
+ ('new_member_options', 'send_reminders',
+ 'subscribe_policy', 'unsubscribe_policy',
+ 'subscribe_auto_approval', 'private_roster',
+ 'admin_member_chunksize'),
+ ())
+
class TestMigration20121015MigratedData(MigrationTestBase):
"""Test non-migrated data."""