3
Tests for L{Filter} schema upgrading.
6
from axiom.test.historic.stubloader import StubbedTest
8
from xquotient.spam import Filter
9
from xquotient.mail import MessageSource
10
from xquotient.exmess import _TrainingInstructionSource
12
from xquotient.test.historic.stub_filter3to4 import USE_POSTINI_SCORE, POSTINI_THRESHHOLD
15
class FilterUpgradeTest(StubbedTest):
17
Tests for L{Filter} schema upgrading.
19
def test_attributes(self):
21
The upgrade preserves the values of all the remaining attributes.
23
filter = self.store.findUnique(Filter)
24
self.assertEquals(filter.usePostiniScore, USE_POSTINI_SCORE)
25
self.assertEquals(filter.postiniThreshhold, POSTINI_THRESHHOLD)
26
self.assertTrue(isinstance(filter.messageSource, MessageSource))
27
self.assertTrue(isinstance(filter.tiSource, _TrainingInstructionSource))