view test/test_misc.py @ 5231:8743b7226dc7

Fix issue with retreiving raw template files using the @@file mechanism. This changes the static_files option in config.ini from supporting a single directory to support multiple directories. If one of the directory elements is '-' (i.e. a lone hyphen) the search is stopped and the TEMPLATES directory is not searched. Since the TEMPLATES directory is not searched the raw templates aren't accessed. See: https://sourceforge.net/p/roundup/mailman/message/35773357/ Message subject: showing template sources to all for details. Also check in CHANGES.txt that mentions a couple of other small improvements in the roundup-admin command.
author John Rouillard <rouilj@ieee.org>
date Tue, 11 Apr 2017 22:20:13 -0400
parents e1e3531b4d9b
children 9a09719b0d8e
line wrap: on
line source

# misc tests

import unittest
from roundup.cgi.accept_language import parse

class AcceptLanguageTest(unittest.TestCase):
    def testParse(self):
        self.assertEqual(parse("da, en-gb;q=0.8, en;q=0.7"),
                         ['da', 'en_gb', 'en'])
        self.assertEqual(parse("en;q=0.2, fr;q=1"), ['fr', 'en'])
        self.assertEqual(parse("zn; q = 0.2 ,pt-br;q =1"), ['pt_br', 'zn'])
        self.assertEqual(parse("es-AR"), ['es_AR'])
        self.assertEqual(parse("es-es-cat"), ['es_es_cat'])
        self.assertEqual(parse(""), [])
        self.assertEqual(parse(None),[])
        self.assertEqual(parse("   "), [])
        self.assertEqual(parse("en,"), ['en'])

Roundup Issue Tracker: http://roundup-tracker.org/