'Now test that we parse a literal HTTP header correctly.'

def test_parse_literal_http_header(self):

    g = get_language_from_request
    r = self.rf.get(u'/')
    r.COOKIES = {}
    r.META = {u'HTTP_ACCEPT_LANGUAGE': u'pt-br'}
    self.assertEqual(u'pt-br', g(r))
    r.META = {u'HTTP_ACCEPT_LANGUAGE': u'pt'}
    self.assertEqual(u'pt', g(r))
    r.META = {u'HTTP_ACCEPT_LANGUAGE': u'es,de'}
    self.assertEqual(u'es', g(r))
    r.META = {u'HTTP_ACCEPT_LANGUAGE': u'es-ar,de'}
    self.assertEqual(u'es-ar', g(r))
    r.META = {u'HTTP_ACCEPT_LANGUAGE': u'es-us'}
    self.assertEqual(g(r), u'es')
    r.META = {u'HTTP_ACCEPT_LANGUAGE': u'zh-cn,de'}
    self.assertEqual(g(r), u'zh-cn')
