~abompard/mailman/import21

« back to all changes in this revision

Viewing changes to src/mailman/model/tests/test_listmanager.py

  • Committer: Aurélien Bompard
  • Date: 2013-10-03 16:37:04 UTC
  • Revision ID: aurelien@bompard.org-20131003163704-d9p7wz110x91p25f
More unicode fixes in the import script

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import unittest
28
28
 
29
29
from zope.component import getUtility
30
 
from storm.locals import Store
31
30
 
32
31
from mailman.app.lifecycle import create_list
33
32
from mailman.app.moderator import hold_message
38
37
from mailman.interfaces.requests import IListRequests
39
38
from mailman.interfaces.subscriptions import ISubscriptionService
40
39
from mailman.interfaces.usermanager import IUserManager
41
 
from mailman.model.mime import ContentFilter
42
40
from mailman.testing.helpers import (
43
41
    event_subscribers, specialized_message_from_string)
44
42
from mailman.testing.layers import ConfigLayer
128
126
        saved_message = getUtility(IMessageStore).get_message_by_id('<argon>')
129
127
        self.assertEqual(saved_message.as_string(), msg.as_string())
130
128
 
131
 
    def test_content_filters_are_deleted_when_mailing_list_is_deleted(self):
132
 
        # When a mailing list with content filters is deleted, the filters must
133
 
        # be deleted fist or an IntegrityError will be raised
134
 
        filter_names = ("filter_types", "pass_types",
135
 
                        "filter_extensions", "pass_extensions")
136
 
        for fname in filter_names:
137
 
            setattr(self._ant, fname, ["test-filter-1", "test-filter-2"])
138
 
        getUtility(IListManager).delete(self._ant)
139
 
        store = Store.of(self._ant)
140
 
        filters = store.find(ContentFilter,
141
 
                             ContentFilter.mailing_list == self._ant)
142
 
        self.assertEqual(filters.count(), 0)
143
 
 
144
129
 
145
130
 
146
131
class TestListCreation(unittest.TestCase):