[TIP] Testing locale-dependent behaviour

Thomas Lotze thomas at thomas-lotze.de
Tue Nov 25 00:52:59 PST 2008

Alexandre Fayolle wrote:

> From what you describe, the availability of a given set of locales looks
> like a dependency for your test, in the same way that you might have a
> dependency on some third party python modules for your tests to run, or on
> some external software configuration (directory layout, some server
> listening on a TCP port...) :

This sounds reasonable. However, as a follow-up question, is there any way
of making a certain locale available (or pretending it was available) to a
test from within the testing process or test setup environment? I'm
comparing the situation to the possibility to install a server locally
into the test environment using zc.buildout, or to create a specifically
layed-out directory tree in the test setup. So is there a way to make sure
of a given locale other than to have someone with root access install it
system-wide, on every machine that might eventually run the test?

> this needs to be documented somewhere, and a
> nice way of making sure the configuration is correct is writing a test for
> it :-)

If nothing else helps, yes :o)


More information about the testing-in-python mailing list