Changeset 10:d5329a2a05b7 in mailjam for postman/tests/models.py


Ignore:
Timestamp:
May 20, 2012, 9:39:51 AM (13 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Fully added support for the configuration file. Now all the code uses
postman.conf to read the configuration parameters from it

Added a tests/postman.conf configuration file with specific configurtion
to use while testing (mostly tmp paths)

Updated the run_tests script to delete the temporary directory where
data is saved while running tests

Updated the tests modules/files so they use the tests config file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postman/tests/models.py

    r1 r10  
    11# -*- coding: utf-8 -*-
    22
     3import os
    34from unittest import TestCase
    45from postman.models import Member, MailingList
     
    1819class TestMailingList(TestCase):
    1920    def setUp(self):
    20         config = {'private': False, 'archive': '/tmp/postman-tests/archive',
    21                   'storage': '/tmp/postman-tests/storage'}
     21        configfile = os.path.join(os.path.dirname(__file__), 'postman.conf')
    2222        self.mailing_list = MailingList('test_list', 'test_list@example.com',
    23                                         members={}, config=config)
     23                                        members={}, configfile=configfile)
    2424        self.member =  Member('test@example.com')
    2525
Note: See TracChangeset for help on using the changeset viewer.