mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 08:04:49 +01:00
* banner: add banner and localization improvements from ukwa branch: - show 'view all captures' link if not live - optional logo - loc options, if available - banner options set via window.banner_info in banner.html localization support: - add init_loc() to templateview - loc available if config options set - tests: add tests for loading localized messages, override .gitignore to allow test messages.mo
32 lines
953 B
Python
32 lines
953 B
Python
from .base_config_test import BaseConfigTest
|
|
|
|
|
|
# ============================================================================
|
|
class TestLocales(BaseConfigTest):
|
|
@classmethod
|
|
def setup_class(cls):
|
|
super(TestLocales, cls).setup_class('config_test_loc.yaml')
|
|
|
|
def test_locale_en_home(self):
|
|
res = self.testapp.get('/en/')
|
|
|
|
assert 'Pywb Wayback Machine' in res.text, res.text
|
|
|
|
def test_locale_l337_home(self):
|
|
res = self.testapp.get('/l337/')
|
|
|
|
print(res.text)
|
|
assert r'Py\/\/b W4yb4ck /\/\4ch1n3' in res.text
|
|
|
|
def test_locale_en_replay_banner(self):
|
|
res = self.testapp.get('/en/pywb/mp_/https://example.com/')
|
|
assert '"en"' in res.text
|
|
assert '"Language:"' in res.text
|
|
|
|
def test_locale_l337_replay_banner(self):
|
|
res = self.testapp.get('/l337/pywb/mp_/https://example.com/')
|
|
assert '"l337"' in res.text
|
|
assert '"L4n9u4g3:"' in res.text
|
|
|
|
|