summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert TestFileRecips to a doctest, and update the handler to more modernBarry Warsaw2007-07-024-101/+115
| | | | | | | | Python idioms. The recipients are now returned as a set instead of a list, so duplicates are quashed. In MailList.InitTempVars() we need to create the list's data directory when the list is initialized. If the directory already exists, this does nothing.
* Convert failing test_message.py to doctests bounces.txt and message.txt, whichBarry Warsaw2007-07-017-106/+170
| | | | | | | | | | | | | of course now succeed. Rename Bouncer.py's BounceMessage() method to bounce_message() and remove the 'msgdata' parameter, which wasn't being used. Change the RejectNotice exception class to expose .notice directly, as there's no reason for this to be an accessor or property. Move the coverage.py installation to the install-packages target instead of the install-other target, so that it only gets installed once the pythonlib directory is created.
* Add support for code coverage with 'testall --coverage'. However, I'm notBarry Warsaw2007-07-013-1/+973
| | | | | | | | | convinced this is totally accurate as a full test run shows almost no coverage in the Mailman.database.model modules even though I /know/ they're getting executed. I'll need to figure this out, but eventually we'll convert fully to setuptools and then we'll use the nosetests to do testing and coverage.
* Support for case-preserving addresses. When an Address is given an emailBarry Warsaw2007-07-016-13/+108
| | | | | | | | | | | | | | | | | | address that is not lower cased, the original, case-preserved version is store on the '_original' attribute. The lower-cased version is always used as the key and thus always stored on the 'address' attribute. The IAddress interface is given a new 'original_address' property which returns the case-preserved version. Address's __str__() and __repr__() are similarly modified. The former always includes the case-preserved address; the latter does too, but now also includes the lower-cased 'key' email address (along with the object's id). Searching for an address always does so on the lower-cased version. Test suite is updated as necessary. Also, I'm adding the REPORT_ONLY_FIRST_FAILURE doctest flag so that it's easier to debug doctest failures without having pages of problems to scroll through.
* Cleaned up a couple of style issues. No actual code changes.Mark Sapiro2007-06-281-6/+7
|
* check_perms checked archives/private/ and archives/private/<list>/database/Mark Sapiro2007-06-281-10/+16
| | | | | | directories to make sure they didn't have certain 'other' permissions, but it didn't check these directories for the necessary user and group permissions. This is now fixed.
* Convert the rest of test_runners.py to doctests; even though incomplete, theyBarry Warsaw2007-06-289-228/+236
| | | | | | | | | | | | | | | | | | | | | | test everything the old unit tests tested. There are XXX's left in the doctests as reminders to flesh them out. Change the NNTP_REWRITE_DUPLICATE_HEADERS to use proper capitalization. Revert a change I made in the conversion of the Switchboard class: Switchboard.files is no longer a generator. The Runner implementation is cleaner if this returns a concrete list, so that's what it does now. Update the tests to reflect that. The Runner simplifies now too because it no longer needs _open_files() or the _listcache WeakValueDictionary. The standard list manager handles all this now, so just use it directly. Also change the way the Runner sets the language context in _onefile(). It still tries to set it to the preferred language of the sender, if the sender is a member of the list. Otherwise it sets it to the list's preferred language, not the system's preferred language. Removed a conditional that can't possibly happen.
* Repair docfiles broken with the new ISwitchboard interface. Mostly these wereBarry Warsaw2007-06-274-29/+48
| | | | | | | | | | due to the change from the method Switchboard.files() to the generator property Switchboard.files. Add support in cleaning_teardown() for the doctests for removing all queue files leftover after a test is complete. This way, failures in one test that queues files won't break all subsequent such tests. Update the 2.1.9 section of the NEWS.txt file from the Mailman 2.1 branch.
* Convert the Switchboard test in test_runners.py to a doctest. Add anBarry Warsaw2007-06-278-162/+341
| | | | | | | | | | | | | | | ISwitchboard interface and modernize the Python code in the Switchboard.py implementation. The SAVE_MSGS_AS_PICKLES option is removed. Messages are always saved as pickles unless the metadata '_plaintext' key is present, though this should eventually go away too. In testall.py, put the entire VAR_PREFIX in a temporary directory. This helps the switchboard tests by not mixing their data with the installation's queue directories. The Configuration object now also ensures that all the queue and log directories exist -- one more step on the road to getting rid of the autoconf mess.
* Simplify doctests by having just a single test_documentation.py module inBarry Warsaw2007-06-2316-393/+69
| | | | | Mailman/testing. This introspects the Mailman/docs directory and adds DocFileSuites for all .txt files found there.
* merging 3.0Barry Warsaw2007-06-222-14/+20
|\
| * Scrubber.py - Malformed RFC 2047 encoded filename= parameter can haveMark Sapiro2007-06-222-14/+20
| | | | | | | | | | | | | | | | a null byte or other garbage in the extension. Cleaned this. - Improved handling of None payloads. - Cleaned up a few charset coercions. OutgoingRunner.py - Made probe bounce processing and queuing of bounces conditional on having some permanent failure(s).
* | Refactor tests to get consistent clean up behavior. The clean up sectionsBarry Warsaw2007-06-2230-265/+64
| | | | | | | | | | have been removed from the .txt files and instead added to the test harness, which all doctests now use.
* | Merge temporary Elixir model branch to the 3.0 trunk. Some tests are failingBarry Warsaw2007-06-2258-1573/+2984
|\ \ | |/ |/| | | now so I have to fix these before pushing the branch up.
| * Convert the AvoidDuplicates handler tests to a doctest. Well,Barry Warsaw2007-06-213-32/+250
| | | | | | | | | | | | | | actually there /was/ no separate AvoidDuplicates test, but now there is, even though it may not be full coverage. Update the AvoidDuplicates handler to use more modern Python idioms.
| * Convert the CookHeaders tests in test_handlers to using doctests, split upBarry Warsaw2007-06-2111-385/+857
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into several sub-documents. Defaults.py.in: Removed OLD_STYLE_PREFIXING. So-called 'new style' prefixing is the default and only option now. CookHeaders.py is updated to the new API and some (but not all) of the code has been updated to more modern Python idioms. reply_goes_to_list attribute has been changed from a strict integer to a munepy enum called ReplyToMunging. RFC 2369 headers List-Subscribe and List-Unsubscribe now use the preferred -join and -leave addresses instead of the -request address with a subject value.
| * Convert the Cleanse handler tests to doctest style.Barry Warsaw2007-06-194-68/+145
| |
| * Convert the tests for the CalcRecips handler to doc tests. There areBarry Warsaw2007-06-1910-130/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some XXX's in the doc test because digest recipients aren't tested (though those may go in a different doctest), and neither are urgent messages. This latter is for the same reason that the Approved handler is not yet tested; which password do you use in that header? The CalcRecips tests would also seem the natural place to test the receive_list_copy preference, but that actually gets processed in the AvoidDuplicates handler, so it isn't tested here. Add delivery_status (of type enum DeliveryStatus) to preferences. I'm not entirely sure that's the right place for it, but it lets me finish converting the test for now. Expose the rest of the preferences through the IMember interface.
| * Convert the AfterDelivery handler test to a doctest. Also, change theBarry Warsaw2007-06-186-17/+88
| | | | | | | | | | MailingList.last_post_time column to a DateTime (i.e. Python datetime object).
| * Remove both the model and interface for RosterSets. These are no longer usedBarry Warsaw2007-06-1813-283/+425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or necessary in the current data model. Convert the test_handlers.py Python test to an acknowledge.txt doctest, and make the Acknowledge.py handler work with the new data model. There are a few XXX comments left in here due to the fact that the web stuff is a total hack in the current branch currently. Added IMailingListWeb methods and properties to the MailingList model class: web_host and script_url(). Work out how IMembers will expose the lookup-order based preferences. By getting the attribute IMember.preferences you can see exactly the preferences overridden by this member. To use the lookup order, use IMember.delivery_mode, IMember.acknowledge_posts, etc. IOW, the IMember interface now provides the properties directly and access through this mechanism supports lookup order with definitive preference values. Also added IMember.unsubscribe() which does the obvious, and IMember.options_url() which is a total hack for providing a url (but not the ultimately right one) for the user's option page. Refactor the model's roster classes. Also added IRoster.get_member() method with efficient queries to return the right results. Make AdministratorRoster.members more efficient due to a better query. Update the membership.txt doctest to eliminate a chance ordering effect, and also to test finding members with .get_member(). The clean up section uses the new .unsubscribe() method.
| * profile.py -> preferences.pyBarry Warsaw2007-06-157-5/+8
| | | | | | | | | | Fix the last few doctests by ensuring that other newly created Addresses have a preferences object.
| * merge work from other machineBarry Warsaw2007-06-1514-120/+171
| |\
| | * Update the IUser interface and tests, specifically as it relates toBarry Warsaw2007-06-1514-120/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | preferences. IAddresses, IUsers, and IMembers all get preferences by default, althoughthe attributes of these preferences are None by default. IMailingLists don't get preferences by default though; because these live in the user database, we can't cross-polinate them in the mailing lists. We'll figure something out later for these. IUser.register(): Add this method which registers and links an address to the user. Allow EnumType database columns to accept and return Nones. This is useful for when the columns are not defined NOT NULL. Update doctests. Removed teh hide_address preference. I can't think of a reason not to want to hide addresses for everyone.
| * | merge upstream trunkBarry Warsaw2007-06-111-5/+21
| |\ \ | | |/ | |/|
| * | add the ignore fileBarry Warsaw2007-06-101-0/+27
| | |
| * | More test updates based on simplified data model. Rosters are gone so theBarry Warsaw2007-06-1010-301/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mlist-rosters.txt tests are removed. Give MailingList entities a Preferences foreign key, so that they now have preferences. Member.preferences(): Watch out for unlinked addresses, i.e. which have no user and thus no user preferences. Address.controls() takes a text email address, not an IAddress. UserManager: add create_address(), delete_address(), get_address(), and 'addresses' property. Updated the address.txt and user.txt doctests as needed. Added User.register() to register an email address and immediately link it to a user.
| * | Repair the usermanager.txt and listmanager.txt doc tests. These repairs wereBarry Warsaw2007-06-096-80/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | necessary to deal with the simplified user model. Eradicate more references to rosters and roster sets. Give Users a repr. Also give them a belongs_to() link to Preferences, but change the user manager to not give a user preferences by default (the lookup schema should properly handle users with no preferences now). Also, when creating a user, set their real_name to the empty string if no real_name argument was given to create_user(). Update the IUserManager interface's create_user() method to match the implementation.
| * | Implement the new, simplified membership model. Rosters and RosterSets asBarry Warsaw2007-06-0921-293/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they were previously known are now gone. Rosters, rather than being a database entity that collects users, is now just a filter on the member database. This way, we can use generic rosters to search for regular members, digest members, owners, or moderators. More advanced rosters can do all kinds of other membership queries. But rosters no longer need to be a database entity. Users have a name, password, optional preferences, and a set of addresses, but users are not subscribed to mailing lists. Addresses have the email address, some verification information, and optional preferences. Members tie an address to a mailing list, through a role, with optional preferences. Other changes here include: MailList.fqdn_listname() moved to the MailingList model entity. Added MemberRole enum and SystemDefaultPreferences to Mailman.constants. Profiles are renamed to Preferences (same with the interface), but the files are not yet moved. This happens later. We mostly don't need has_*() relationships on the entity classes, because we generally don't need the reverse relationship. Use belongs_to() because that creates the foreign key, even though the wording seems counter intuitive. IAddress.subscribe() added. Tell Elixir to use shortnames for all tables. Remove the OldStyleMembership fields from MailingList. Remove all the interface elements and database fields that talk about rosters and rostersets. Convert Version entity to has_field().
* | | senddigests.py - Changed to catch exceptions thrown by ↵msapiro2007-06-151-2/+13
| | | | | | | | | | | | | | | mlist.send_digest_now() and report them and continue processing the remaining lists.
* | | admindb.py - Changed to not show the "Discard all messages marked Defer" ↵msapiro2007-06-121-4/+7
| |/ |/| | | | | | | | | | | | | | | | | checkbox when there are only (un)subscribes and no held messages. - Added a separator and heading for "Held Messages" like the ones for "Subscribe Requests" and "Unsubscribe Requests". - Added additional test to not display "Database Updated ..." when coming from the login page.
* | Improved processing of an Approve(d): body line by decoding the body payloadmsapiro2007-06-091-5/+21
|/ | | before looking for/deleting the Approve(d): line.
* rename a few testsbwarsaw2007-06-024-2/+2
|
* Add doctest for Replybot handler. The test in test_handlers.py didn't reallybwarsaw2007-05-315-37/+277
| | | | | | | | | do anything. The doctest needs to have some way of testing the grace period, but it's still more tests of the module than there every was before. Update the Replyboty handler to use $-strings internally. Eliminate the use of %-strings in auto-response textsy. Only $-strings can be used, which allows us to get rid of another use of SafeDict.
* Remove leftover reference to removed Mailman.database.tables.languagesbwarsaw2007-05-303-2/+11
| | | | | | | | | module. Add in a temporary reference (with XXX comment) to Mailman.database.model.Language where necessary, although I will need to remove this eventually. Added clean up code to the mlist-rosters.txt doctest, otherwise it leaks the test mailing list.
* Go ahead and remove the Mailman/database/tables directory since all the Elixirbwarsaw2007-05-3017-789/+385
| | | | | | | | | | | | | | | | | | classes live in Mailman/databae/model now. Remove the TestDecorate test class from test_handlers.py and move them into a doctest called decorate.txt (with harness in test_decorate.py). Remove the dependence on SafeDict from the Decorate handler because I can now use string.Template object to safely fill in header and footer templates. Eventually I want to completely remove SafeDict from Mailman, but it's still used in a few other places. This also means that only $-strings will be supported in headers and footers, and the import script will have to convert %-strings to $-strings. Also, '_internal_name' is no longer a supported header/footer substitution variable. Use $real_name or $list_name now. Added $fqdn_listname as a substitution variable. Update the DEFAULT_MSG_FOOTER accordingly.
* Support resetting a user's password if the imported file does not have abwarsaw2007-05-291-6/+13
| | | | password for the user, or if it's "{NONE}".
* Minor style issue.bwarsaw2007-05-291-1/+1
|
* Merge exp-elixir-branch to trunk. There is enough working to make me feelbwarsaw2007-05-28111-2958/+6396
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | confident the Elixir branch is ready to become mainline. Also, fewer branches makes for an easier migration to a dvcs. Don't expect much of the old test suite to work, or even for much of the old functionality to work. The changes here are disruptive enough to break higher level parts of Mailman. But that's okay because I am slowly building up a new and improved test suite, which will lead to a functional system again. For now, only the doctests in Mailman/docs (and their related test harnesses) will pass, but they all do pass. Note that Mailman/docs serve as system documentation first and unit tests second. You should be able to read the doctest files to understand the underlying data model. Other changes included in this merge: - Added the Mailman.ext extension package. - zope.interfaces uses to describe major components - SQLAlchemy/Elixir used as the database model - Top level doinstall target renamed to justinstall - 3rd-party packages are now installed in pythonlib/lib/python to be more compliant with distutils standards. This allows us to use just --home instead of all the --install-* options. - No longer need to include the email package or pysqlite, as Python 2.5 is required (and comes with both packages). - munepy package is included, for Python enums - IRosterSets are added as a way to manage a collection of IRosters. Roster sets are named so that we can maintain the indirection between mailing lists and rosters, where the two are maintained in different storages. - IMailingListRosters: remove_*_roster() -> delete_*_roster() - Remove IMember interface. - Utils.list_names() -> config.list_manager.names - fqdn_listname() takes an optional hostname argument. - Added a bunch of new exceptions used throughout the new interfaces. - Make LockFile a context manager for use with the 'with' statement.
* Minor update to test bzr sync'ingbwarsaw2007-05-081-3/+3
|
* update the wiki urlbwarsaw2007-04-301-4/+2
|
* Another round of merges of my Pycon branch...bwarsaw2007-04-179-67/+575
| | | | | | | | | | | | | | | | | | | | bin/testall.py - Improvements to setting up the tests with temporary files for the db and configuration. Don't accept -C/--config because that will just confuse things. - Copy our new testing.cfg.in template file to a temp file, populate it with a few additional run-time calculate values, and use that in both the parent (bin/testall script) and children (bin/mailmanctl and friends). Mailman/initialize.py - Split up initialize() into two functions as required by the test suite reorg above. Almost everything else in Mailman will continue to use the initialize() function though. Mailman/configuration.py - Store the filename that was used to load the .cfg file from on the configuration object.
* Python 2.5 is the required minimum now and that comes with the required ↵bwarsaw2007-04-122-1/+1
| | | | version of the email package. So, finally! we can get rid of our copy.
* Add a missing import.bwarsaw2007-04-103-246/+499
| | | | Python 2.5 is required.
* Improve the way we handle avoiding InitTempVars() multiple times on anbwarsaw2007-04-095-31/+55
| | | | | | | | | | | | | | | | | | | instantiated MailList object via the mapper extension's populate_instance() method. This based on information from the SQLAlchemy folks. Add more useful output for LockFile debugging. Add checks in loginit.py's emit() method (and .flush()) so that if the stream has been closed, log messages will go to stderr. This happens under the test suite with SQLAlchemy, because SA keeps references to the MailList objects which it doesn't seem like we can clear before Python exits. So if say the lock logger is at debug level, when the lock object gets cleared at Python shutdown, the stream will have been closed by the time LockFile.__del__() gets called. This change avoids the traceback at the expense of a little extra stderr output. MailList.__lock -> MailList._lock MailList.__timestamp -> MailList._timestamp
* r8187 from 2.1-maint branch; fix bin/withlist -r to work with package pathsbwarsaw2007-04-051-2/+3
| | | | more deeply nested than 1 level.
* Moved the session.expire() to the MailList.Load() method, viabwarsaw2007-04-034-2/+15
| | | | | | | | | | | | | | | | | DBContext.api_load(). This is where it really ought to be based on the internal semantics of .Load()/.Lock(). MailListMapperExtension.populate_instance(): Checking the state of the isnew flag is not sufficient to know whether the MailList object we're getting is brand spankin' new or not. It turns out that when we session.expire() the MailList object, the next time SA loads this from the db, the populate_instance() will get called with isnew=True, even though the object really isn't new. Instead, check to make sure InitTempVars() isn't incorrectly called twice. Note that I might move this test, but I wanted to check in something that works, and then see if this is what we expect from the SA guys (this flag appears underdocumented). LockFile.py: Add some additional debugging.
* Add a configuration variable called LOG_CONFIG_FILE. If set, this names abwarsaw2007-03-312-47/+79
| | | | | | | | | | | | | | | ConfigParser style ini file which can be used to override various default settings for just the named loggers. For example, if you want just the locks logger to print at DEBUG level, add this: etc/mailman.cfg: LOG_CONFIG_FILE = 'etc/mailman.log' etc/mailman.log: [locks] level = DEBUG
* api_lock(): When locking the MailList object, tell the SQLAlchemy session tobwarsaw2007-03-302-1/+1
| | | | | | | | | | | expire the object. This way, when the MailList attributes are next accessed, the ORM will reload them from the database, getting any new values possibly set in other processes. This works better than trying to use always_refresh=True on the mapper, or trying to do a reload() because both of those approaches blow away locks. I'm not sure why this, but I suspect that it's because the identity map is handing us back a different object, rather than invalidating the object's attributes.
* passwords.py: 'utf-8' normalization.tkikuchi2007-03-272-3/+3
| | | | | Cgi/create.py: password scheme lookup.
* Fix passwords in bin/newlist. Yes, this needs unit tests!bwarsaw2007-03-271-6/+6
|