summaryrefslogtreecommitdiff
path: root/src/mailman/testing
Commit message (Collapse)AuthorAgeFilesLines
* Merge passwords into restBarry Warsaw2011-04-081-0/+2
|\
| * encrypt_password(): New convenience function for ensuring that a password isBarry Warsaw2011-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | both encrypted according to a scheme, and a bytes object. add_member(): Use encrypt_password(). cli_members: Give the user a default, user-friendly password. Of course, this will be encrypted so it can't be retrieved, but it can be reset. Passwords are stored as bytes objects, not unicode now. ConfigLayer: Set the default test password scheme to cleartext. General test repair.
* | Removing debugging printBarry Warsaw2011-04-041-1/+0
| |
* | More fleshing out of the users REST API.Barry Warsaw2011-04-041-0/+14
|/ | | | | | | | | | | | | | * Add a 'uid factory' which allows us to return predictable unique ids for various testing purposes, e.g. user ids. This should work even in the case of cross-subprocess uid generation. * REST access to individual users, or the set of all users. * User objects now have a created_on attribute. * Users can be created through the web, but must have an email address. * Add a [devmode] 'testing' variable for communicating to qrunner subprocesses that we're running in testing mode. This allows us to coordinate factories and such in the qrunner processes. * layers.is_testing() for more consistent API. * Give AddressError a .address attribute for better diagnostics.
* * Re-organize the interface between buildout.cfg and the zope.testing layerBarry Warsaw2011-04-012-8/+49
| | | | | | | | | | | | | | | | | | | initialization. buildout.cfg is now really simple; it calls one method. That method does all the relevant layer initializations. This better localizes what has to be set up before testing can even begin. * IUsers now have a created_on property which contains the datetime at which the user record was created. * Rework the date and uid factories so that they consult the MockAndMonkeyLayer for the current testing flag. Also, those factories register themselves with the layer so that they'll get automatically reset between tests, without the layer actually having to know about them. * Move the User model object initialization into User.__init__() from the user manager. The User now also adds itself to the store. * Add a 'uid factory' for unique id creation, which is test suite aware.
* Fixed a typo in add_member() which prevented subscribing an email address thatBarry Warsaw2011-01-312-15/+32
| | | | | | | | was already linked to a user. Found by Florian Fuchs who also provided the fix, though I implemented the test differently. LP: #710182 Also, refactor the "reset the world" functionality ConfigLayer.testTearDown() so that it could be used by other test code.
* LP: #490044 - Support SMTP AUTH.Barry Warsaw2011-01-022-0/+34
| | | | | Added smtp_user and smtp_pass options to the [mta] section to support logging into the SMTP server. All the underlying support is in Python's smtplib.
* Split member and nonmember moderation.Barry Warsaw2011-01-021-7/+16
| | | | | | | | | | | | | | | | * member-moderation happens at the same place in the built-in chain that the previously named moderation rule happens. nonmember-moderation happens after all the other normal moderation rules. * Handle unsubscribed nonmember posts. Other changes: * Message.senders now filters out Nones and empty strings. * Various test cleanups and simplifications. * More `address` -> `email` fixes. * Give Link class a useful repr. * Fix a potential UnboundLocalError. * Various other small changes.
* Happy New Year.Barry Warsaw2011-01-014-4/+4
|
* Insulate the test environment from the running environment. Sadly, the testBarry Warsaw2010-12-222-1/+5
| | | | | | ports are still hard coded. Also, 'bin/mailman info' dumps the REST root url and credentials.
* Add Basic Auth support to the REST API, given by Jimmy Bergman, with styleBarry Warsaw2010-10-111-2/+8
|\ | | | | | | corrections by Barry.
| * Add doctest for connecting using invalid credentials and some documentation ↵root2010-09-291-2/+6
| | | | | | | | regarding the basic auth for the REST server.
* | Fix the obvious errors identified by pyflakes. Skip false positives (mostlyBarry Warsaw2010-10-083-4/+2
|/ | | | | due to _() interpolation) and a few other problems that did not have immediately obvious fixes.
* This is a better fix than the previous commit, since it uses a principled ↵Barry Warsaw2010-08-301-0/+15
| | | | approach to finding the bin directory. Thanks go to Gary Poster.
* * Fix the bin/test -e/--stderr option to work with the currentBarry Warsaw2010-06-182-13/+34
| | | | | | | | | | | | | zope.testrunner. Actually, divorce it from the latter and handle the sys.argv sequence ourselves. * Added IMailingList.get_roster() which returns the named roster (from a MemberRole enum). * The start of an IMailingList doctest. This needs much more detail. * Move the subscribe() function from membership.txt into the mailman.testing.helpers. * Added new REST interface for getting all the members of a roster for a specific mailing list: .../lists/<list>/roster/<role>. Note that <role> is the plural form of the MemberRole enum.
* Updates for the latest releases of flufl.enum and flufl.i18n.Barry Warsaw2010-05-021-2/+2
|
* * A start to import of Mailman 2.1 config.pck files.Barry Warsaw2010-04-051-0/+0
| | | | * Move DigestFrequency from mailinglist to digests.
* Chains now fire Zope events in their _process() implementation.Barry Warsaw2010-02-161-1/+24
| | | | Clean up the chains.txt doctest to use this and other recent improvements.
* Checkpointint support for different path layouts, allowing us to optionallyBarry Warsaw2010-01-271-1/+6
| | | | | | | | support the Filesystem Hierarchy Standard. This is done through the configuration file. * add a --paths/-p option to 'bin/mailman info' * PIDFILE -> PID_FILE
* Happy New Year.Barry Warsaw2010-01-015-5/+5
|
* The test suite has to be able to inhibit the loading of any configurationBarry Warsaw2009-12-131-1/+2
| | | | files.
* * Make IDomainManager a utility, since the config object is global.Barry Warsaw2009-12-081-1/+1
| | | | | | | | * Give IMailingList a .domain attribute which looks up the IDomain for its .host_name. This cleans up a lot of code. * Add a test for the 'confirm' email command. * Suppress blank lines in email command responses. * Make the IDomainCollection a utility.
* The delivery agent requires that the message object have a .original_sizeBarry Warsaw2009-12-041-1/+0
| | | | attribute. Add this for UserNotifications.
* Convert bin/genaliases to bin/mailman aliasesBarry Warsaw2009-11-281-1/+1
|
* Do not create the .mo files during setup. This makes things go much faster.Barry Warsaw2009-11-243-0/+140
| | | | | The tests do require a partial French translation for digester.txt, so just include the bare minimum, already msgfmt'd in the mailman.testing package.
* Factor out most of the i18n subsystem and convert to using the flufl.i18nBarry Warsaw2009-11-151-1/+1
| | | | package.
* Fix all tests except outgoing.txt and common.txtBarry Warsaw2009-11-021-1/+1
|
* Handle SMTPResponseExceptions like smtp_direct.py, but without the distinctionBarry Warsaw2009-10-311-13/+39
| | | | between temporary and permanent failures. That will happen at a higher level.
* IMailTransportAgentDelivery.deliver() returns a dictionary just likeBarry Warsaw2009-10-311-6/+38
| | | | | | | | | SMTP.sendmail(). Handle SMTPRecipientsRefused just like smtp_direct.py. Hack the test mail server to be able to generate failures. SMTP responses must be bytes (don't forget we're using unicode literals).
* IMailTransportAgent -> IMailTransportAgentAliasesBarry Warsaw2009-10-181-2/+2
| | | | Add IMailTransportAgentDelivery and begin to flesh out the doctest.
* Show that a max_sessions_per_connection == 0 means there's an unlimited numberBarry Warsaw2009-10-182-19/+19
| | | | of sessions per connection (or at least 10 <wink>).
* Show that the session count is zero at first.Barry Warsaw2009-10-181-27/+18
|
* Infrastructure for testing the Connection class, and for counting the numberBarry Warsaw2009-10-182-16/+105
| | | | of session start and end events in the server.
* Use lazr.smtptest instead of our own SMTPServer and test SMTPd.Barry Warsaw2009-10-153-159/+19
| | | | | Update the lazr.restful IWebServiceConfiguration implementation to include the new hop_by_hop_headers attribute, by way of BaseWSGIWebServiceConfiguration.
* When testing, the signal.pause() is a problem because the TestableMaster isBarry Warsaw2009-10-151-1/+7
| | | | | never killed with a signal. In the real-world, it is though. So put the .pause() in a method that can be overridden by TestableMaster.
* Replace the message_store instance on the database with an IMessageStoreBarry Warsaw2009-08-261-2/+5
| | | | utility.
* Wow. Put domains into the database.Barry Warsaw2009-07-162-6/+6
| | | | | | | | Add an IDomainManager and a global domain manager which can be gotten by adapting the global config object. Add an IDomainCollection interface for exposing the domain manager onto the API.
* Clean a few more lints.Barry Warsaw2009-07-101-4/+20
| | | | | | | | | | | | | | Add get_mailing_lists() which is used just for the web interface. Because of a bug in lazr.restful, this cannot be a generator. Similar change in IDomainSet. Instrument IListManager to be vended through the api. The REST server must be run in a separate process since SQLite does not like objects created in one thread to be used in another thread. Note that this breaks the domain.txt test, but domains really need to be in the database anyway.
* Set testing threads as daemon so they won't hang.Barry Warsaw2009-06-291-0/+2
| | | | Fix system absolute url.
* Allow for setting the doctest layer in the doctest package's __init__. If notBarry Warsaw2009-05-271-0/+21
| | | | given, then SMTPLayer is used by default.
* More tests for the REST server, this time, for the queue runner.Barry Warsaw2009-05-101-1/+28
| | | | | | | | | | | Add logging to the RESTRunner. Also, use pkg_resources.resource_stream() instead of .resource_string() where appropriate. Add a bunch of XXX comments for things I need to figure out about the Zope-ish parts of the lazr.restful implementation. Change __getitem__() api to _lookup().
* Minor cleanupsBarry Warsaw2009-03-051-2/+5
|
* Add a "mock and monkey" layer to set up testing infrastructure, e.g. forBarry Warsaw2009-02-171-1/+20
| | | | | | | | | | predictable dates and times. Fill out the autorespond.txt test to show that when the date flips over, the response counts reset. Add a date/time factory which we should use rather than the built-in datetime for now() and today() so that they can be appropriately tested.
* Massive digester rework.Barry Warsaw2009-02-041-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves actual digest creation and sending into a new queue runner. That way, digest creation does not block the main incoming processor. Lots of code clean up and reorganization too, and many fixes. digest_last_sent_at: Make this a DateTime digest_size_threshold: Make this a Float digest_volume_frequency: Make this an Enum DigestFrequency: new enum Fix up IMailingList interface to reflect reality. In Runner base class, allow for msg.get_sender() to return a False value. If this happens (as it can with the empty marker messages used to signal the digester that there's work to do), just use the list's preferred language. Give the retry.py and incoming.py queue runner modules some proper epilogues. The EmptyingRunner (for testing) logs itself as the runner its wrapping. The digest file name now ends in .mmdf since that's the format we're using. Add 'create_list' to doctest globals. Add a Mailbox class to add support for the context manager protocol.
* Push the source directory into a 'src' subdirectory so that zc.buildout worksBarry Warsaw2009-01-256-0/+682
correctly regardless of how it's used.