twisted.news.test.test_database.ModerationTestsMixin class documentationtwisted.news.test.test_database
(View In Hierarchy)
Known subclasses: twisted.news.test.test_database.NewsShelfTests, twisted.news.test.test_database.PickleStorageTests
Tests for the moderation features of INewsStorage
implementations.
| Method | setUp | Undocumented | 
| Method | sendmail | Fake of twisted.mail.smtp.sendmailwhich records attempts to send email and immediately pretends success. | 
| Method | getApprovedMessage | Return a strcontaining an RFC 2822 formatted message 
including an Approved header indicating it has passed through 
moderation. | 
| Method | getUnapprovedMessage | Return a strcontaining an RFC 2822 formatted message with 
no Approved header indicating it may require moderation. | 
| Method | getStorage | Override in a subclass to return a INewsStorageprovider to test for correct moderation behavior. | 
| Method | test_postApproved | INewsStorage.postRequestposts the message if it includes an Approved header. | 
| Method | test_postModerated | INewsStorage.postRequestforwards a message to the moderator if it does not include an 
Approved header. | 
| Method | _checkModeratorMessage | Undocumented | 
Fake of twisted.mail.smtp.sendmail
which records attempts to send email and immediately pretends success.
Subclasses should arrange for their storage implementation to call this 
instead of the real sendmail function.
Return a str containing an RFC 2822 formatted message 
including an Approved header indicating it has passed through 
moderation.
Return a str containing an RFC 2822 formatted message with 
no Approved header indicating it may require moderation.
Override in a subclass to return a INewsStorage
provider to test for correct moderation behavior.
| Parameters | groups | A listofstrnaming the groups which should 
exist in the resulting storage object. | 
| moderators | A dictmappingstreach group name to alistofstrgiving moderator email (RFC 2821) 
addresses. | 
INewsStorage.postRequest
posts the message if it includes an Approved header.
INewsStorage.postRequest
forwards a message to the moderator if it does not include an 
Approved header.