Index: postman/tests/daemon.py
===================================================================
--- postman/tests/daemon.py	(revision 9)
+++ postman/tests/daemon.py	(revision 10)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
 
-import os, multiprocessing, xmlrpclib
+import os, multiprocessing, xmlrpclib, time
 from SimpleXMLRPCServer import SimpleXMLRPCServer
 from unittest import TestCase
@@ -18,12 +18,11 @@
     """
     def setUp(self):
-        config = {'private': False, 'archive': '/tmp/postman-tests/archive',
-                  'storage': '/tmp/postman-tests/storage'}
+        self.configfile = os.path.join(os.path.dirname(__file__), 'postman.conf')
         self.mailing_list = MailingList('test_list', 'test_list@example.com',
-                                        members={}, config=config)
+                                        members={}, configfile=self.configfile)
         self.member =  Member('test@example.com')
 
     def test___init__(self):
-        postman = Postman()
+        postman = Postman(configfile=self.configfile)
         self.assertIsInstance(postman, Postman)
         self.assertEqual(postman.mailings, {})
@@ -36,5 +35,5 @@
 
     def test_save(self):
-        postman = Postman()
+        postman = Postman(configfile=self.configfile)
         self.assertFalse(postman.save())
         postman.add_mailing_list(self.mailing_list.info())
@@ -47,5 +46,5 @@
 
     def test_load(self):
-        postman = Postman()
+        postman = Postman(configfile=self.configfile)
         self.assertFalse(postman.mailings)
         self.assertFalse(postman.mailings_addresses)
@@ -55,5 +54,5 @@
 
         # Check that another postman instance is able to load the saved data
-        postman_load = Postman()
+        postman_load = Postman(configfile=self.configfile)
         self.assertFalse(postman_load.mailings)
         self.assertFalse(postman_load.mailings_addresses)
@@ -68,5 +67,5 @@
 
     def test_clear(self):
-        postman = Postman()
+        postman = Postman(configfile=self.configfile)
         self.assertFalse(postman.clear())
         postman.add_mailing_list(self.mailing_list.info())
@@ -74,5 +73,5 @@
 
     def test_add_mailing_list(self):
-        postman = Postman()
+        postman = Postman(configfile=self.configfile)
         with self.assertRaises(TypeError):
             # test improper info values
@@ -100,5 +99,5 @@
 
     def test_add_mailing_member(self):
-        postman = Postman()
+        postman = Postman(configfile=self.configfile)
         postman.add_mailing_list(self.mailing_list.info())
         with self.assertRaises(ValueError):
@@ -133,12 +132,13 @@
     """
     def setUp(self):
-        config = {'private': False, 'archive': '/tmp/postman-tests/archive',
-                  'storage': '/tmp/postman-tests/storage'}
-        self.mailing_list = MailingList('test_xmlrpc', 'test_xmlrpc@example.com',
-                                        members={}, config=config)
+        self.configfile = os.path.join(os.path.dirname(__file__),
+                                       'postman.conf')
+        self.mailing_list = MailingList('test_xmlrpc',
+                                        'test_xmlrpc@example.com', members={},
+                                        configfile=self.configfile)
         self.member =  Member('test@example.com')
 
     def test___init__(self):
-        daemon = PostmanDaemon()
+        daemon = PostmanDaemon(self.configfile)
         self.assertIsInstance(daemon, PostmanDaemon)
         self.assertFalse(daemon.ready_to_serve)
@@ -147,5 +147,5 @@
 
     def test_create_server(self):
-        daemon = PostmanDaemon()
+        daemon = PostmanDaemon(self.configfile)
         daemon.port = 9001
         self.assertTrue(daemon.create_server())
@@ -154,10 +154,10 @@
         
     def test_add_methods(self):
-        daemon = PostmanDaemon()
+        daemon = PostmanDaemon(self.configfile)
         daemon.port = 9002
         self.assertTrue(daemon.add_methods())
         self.assertTrue(daemon.ready_to_serve)
 
-        daemon = PostmanDaemon()
+        daemon = PostmanDaemon(self.configfile)
         daemon.port = 9003        
         daemon.create_server()
@@ -166,5 +166,5 @@
         
     def test_run(self):
-        daemon = PostmanDaemon()
+        daemon = PostmanDaemon(self.configfile)
         daemon.port = 9004
         # start the daemon in another process, so we can start communicating
@@ -172,4 +172,8 @@
         p = multiprocessing.Process(target=daemon.run)
         p.start()
+
+        # Add a delay here to allow the server to be fully started before
+        # starting to send requests from the client
+        time.sleep(2)
         
         # FIXME: Hardcoded url here, should be picked from a config file        
Index: postman/tests/models.py
===================================================================
--- postman/tests/models.py	(revision 1)
+++ postman/tests/models.py	(revision 10)
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
 
+import os
 from unittest import TestCase
 from postman.models import Member, MailingList
@@ -18,8 +19,7 @@
 class TestMailingList(TestCase):
     def setUp(self):
-        config = {'private': False, 'archive': '/tmp/postman-tests/archive',
-                  'storage': '/tmp/postman-tests/storage'}
+        configfile = os.path.join(os.path.dirname(__file__), 'postman.conf')
         self.mailing_list = MailingList('test_list', 'test_list@example.com',
-                                        members={}, config=config)
+                                        members={}, configfile=configfile)
         self.member =  Member('test@example.com')
 
Index: postman/tests/mta.py
===================================================================
--- postman/tests/mta.py	(revision 5)
+++ postman/tests/mta.py	(revision 10)
@@ -6,11 +6,10 @@
 from postman.models import Member, MailingList
 
-
 class TestSendmail(TestCase):
     def setUp(self):
-        config = {'private': False, 'archive': '/tmp/postman-tests/archive',
-                  'storage': '/tmp/postman-tests/storage'}
+        self.configfile = os.path.join(os.path.dirname(__file__),
+                                       'postman.conf')
         self.mailing_list = MailingList('test_list', 'test_list@example.com',
-                                        members={}, config=config)
+                                        members={}, configfile=self.configfile)
         self.member =  Member('test@example.com')
         self.mta = Sendmail(self.mailing_list)
Index: postman/tests/postman.conf
===================================================================
--- postman/tests/postman.conf	(revision 10)
+++ postman/tests/postman.conf	(revision 10)
@@ -0,0 +1,29 @@
+#
+# postman.conf - Postman configuration file
+#
+# IMPORTANT: This config file should be used only
+# for testing purposes
+
+[xmlrpc_server]
+address = localhost
+port = 9876
+ssl = false
+logfile = /tmp/postman-tests/xmlrpc_server.log
+
+[storage]
+backend = json
+path = /tmp/postman-tests/storage
+lists_db = %(path)s/mailings.%(backend)s
+members_db = %(path)s/members.%(backend)s
+
+[archive]
+enabled = true
+backend = json
+path = /tmp/postman-tests/archives
+
+[mailing_lists]
+private = true
+
+[members]
+auto_signup = false
+allow_chpasswd = false
