Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: tests/xtm_conftest.py

Issue 29906560: Issue 7042 - [XTM Integration] Solve UnicodeDecodeErrors occuring (Closed)
Patch Set: Created Oct. 10, 2018, 1:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 from __future__ import unicode_literals 1 from __future__ import unicode_literals
2 2
3 import os 3 import os
4 import shutil 4 import shutil
5 import json 5 import json
6 6
7 import pytest 7 import pytest
8 from cms.sources import FileSource 8 from cms.sources import FileSource
9 from wsgi_intercept import add_wsgi_intercept 9 from wsgi_intercept import add_wsgi_intercept
10 from wsgi_intercept import remove_wsgi_intercept 10 from wsgi_intercept import remove_wsgi_intercept
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 106
107 @pytest.fixture 107 @pytest.fixture
108 def intercept_too_many_targets(): 108 def intercept_too_many_targets():
109 targets = ['de_DE', 'es_ES'] 109 targets = ['de_DE', 'es_ES']
110 app = get_configured_app(target_langs=targets) 110 app = get_configured_app(target_langs=targets)
111 requests_intercept.install() 111 requests_intercept.install()
112 add_wsgi_intercept(_INTERCEPT_HOST, _INTERCEPT_PORT, lambda: app) 112 add_wsgi_intercept(_INTERCEPT_HOST, _INTERCEPT_PORT, lambda: app)
113 yield app 113 yield app
114 remove_wsgi_intercept() 114 remove_wsgi_intercept()
115
116
117 @pytest.fixture
Vasily Kuznetsov 2018/10/10 14:01:26 I would say that it makes sense to just add this f
Tudor Avram 2018/10/11 13:58:28 Done.
118 def tmpsite_with_unicode(tmpdir):
119 out_dir = tmpdir.mkdir('temp_site_unicode')
120 site_dir = out_dir.join('test_site').strpath
121
122 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
123
124 with open(os.path.join(site_dir, 'pages', 'unicode.md'), 'wb') as f:
125 f.write("- {{simple \u1234 | translate('utf-8')}}.".encode('utf-8'))
126
127 return site_dir
OLDNEW
« tests/test_xtm_translations_utils.py ('K') | « tests/test_xtm_translations_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld