Move gettextutils installation in tests to core

gettextutils.install was done in tests/__init__.py, but this was
not consistent with how test environment setup is done. We have
code to set up the environment in core.py, so other environment
setup should be there. Also, this makes tests/__init__.py cleaner.

Change-Id: I762c8fa715e9c6ec26722fcd9b0ba0f9d613cb43
This commit is contained in:
Brant Knudson 2013-09-08 14:45:20 -05:00
parent 77092b406b
commit 103efd2e27
2 changed files with 13 additions and 12 deletions

View File

@ -14,16 +14,4 @@
# License for the specific language governing permissions and limitations
# under the License.
from keystone.openstack.common import gettextutils
# NOTE(blk-u):
# gettextutils.install() must run to set _ before importing any modules that
# contain static translated strings.
#
# Configure gettextutils for deferred translation of messages
# so that error messages in responses can be translated according to the
# Accept-Language in the request rather than the Keystone server locale.
gettextutils.install('keystone', lazy=True)
from keystone.tests.core import * # flake8: noqa

View File

@ -30,6 +30,19 @@ from paste import deploy
import stubout
import testtools
from keystone.openstack.common import gettextutils
# NOTE(blk-u):
# gettextutils.install() must run to set _ before importing any modules that
# contain static translated strings.
#
# Configure gettextutils for deferred translation of messages
# so that error messages in responses can be translated according to the
# Accept-Language in the request rather than the Keystone server locale.
gettextutils.install('keystone', lazy=True)
from keystone.common import environment
environment.use_eventlet()