11import shutil , errno , pytest , json , gzip , os , re
22
3+ from roundup import i18n
34from roundup .anypy .strings import b2s
45from roundup .cgi .wsgi_handler import RequestDispatcher
56from .wsgi_liveserver import LiveServerTestCase
4041class SimpleTest (LiveServerTestCase ):
4142 # have chicken and egg issue here. Need to encode the base_url
4243 # in the config file but we don't know it until after
43- # the server is started nd has read the config.ini.
44+ # the server is started and has read the config.ini.
4445 # so only allow one port number
4546 port_range = (9001 , 9001 ) # default is (8080, 8090)
4647
@@ -49,7 +50,7 @@ class SimpleTest(LiveServerTestCase):
4950
5051 @classmethod
5152 def setup_class (cls ):
52- '''All test in this class use the same roundup instance.
53+ '''All tests in this class use the same roundup instance.
5354 This instance persists across all tests.
5455 Create the tracker dir here so that it is ready for the
5556 create_app() method to be called.
@@ -75,6 +76,13 @@ def setup_class(cls):
7576
7677 cls .db .commit ()
7778 cls .db .close ()
79+
80+ # Force locale config to find locales in checkout not in
81+ # installed directories
82+ cls .backup_domain = i18n .DOMAIN
83+ cls .backup_locale_dirs = i18n .LOCALE_DIRS
84+ i18n .LOCALE_DIRS = ['locale' ]
85+ i18n .DOMAIN = ''
7886
7987 @classmethod
8088 def teardown_class (cls ):
@@ -87,6 +95,8 @@ def teardown_class(cls):
8795 shutil .rmtree (cls .dirname )
8896 except OSError as error :
8997 if error .errno not in (errno .ENOENT , errno .ESRCH ): raise
98+ i18n .LOCALE_DIRS = cls .backup_locale_dirs
99+ i18n .DOMAIN = cls .backup_domain
90100
91101 def create_app (self ):
92102 '''The wsgi app to start'''
0 commit comments