cryptonas/plugins/help/unittests.py
lars 1438913656 renamed python package to cryptobox-server
unittests are working again
http-error handling implemented
2006-11-27 19:25:26 +00:00

30 lines
1 KiB
Python

import cryptobox.web.testclass
from twill.errors import *
class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
def test_help_pages(self):
'''help pages should be available in different languages'''
## check english help pages
self.cmd.go(self.URL + "help?weblang=en")
self.cmd.find("Table of Contents")
self.cmd.find("Getting started")
self.cmd.go(self.URL + "help?weblang=de")
self.cmd.find("Table of Contents")
self.cmd.find("Wie geht es los")
self.cmd.go(self.URL + "help?weblang=si")
self.assertRaises(TwillAssertionError, self.cmd.notfind, "Table of Contents")
#TODO: add a slovene text here, as soon as the help is translated
self.cmd.go(self.URL + "help?weblang=fr")
self.assertRaises(TwillAssertionError, self.cmd.notfind, "Table of Contents")
#TODO: add a french text here, as soon as the help is translated
## test a random language - it should fall back to english
self.cmd.go(self.URL + "help?weblang=foobar")
self.assertRaises(TwillAssertionError, self.cmd.notfind, "Table of Contents")