Ticket #5496: django_views_tests.diff
File django_views_tests.diff, 9.1 KB (added by , 17 years ago) |
---|
-
tests/regressiontests/django_views/locale/en/LC_MESSAGES/djangojs.po
No se puede mostrar: el archivo está marcado como binario. svn:mime-type = application/octet-stream Cambios de propiedades en tests/regressiontests/django_views/locale/en/LC_MESSAGES/djangojs.mo ___________________________________________________________________ Nombre: svn:mime-type + application/octet-stream
1 # SOME DESCRIPTIVE TITLE. 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 # This file is distributed under the same license as the PACKAGE package. 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 5 # 6 #, fuzzy 7 msgid "" 8 msgstr "" 9 "Project-Id-Version: PACKAGE VERSION\n" 10 "Report-Msgid-Bugs-To: \n" 11 "POT-Creation-Date: 2007-09-15 16:45+0200\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n" 15 "MIME-Version: 1.0\n" 16 "Content-Type: text/plain; charset=UTF-8\n" 17 "Content-Transfer-Encoding: 8bit\n" 18 19 msgid "this is to be translated" 20 msgstr "this is to be translated in english" -
tests/regressiontests/django_views/locale/es/LC_MESSAGES/djangojs.po
No se puede mostrar: el archivo está marcado como binario. svn:mime-type = application/octet-stream Cambios de propiedades en tests/regressiontests/django_views/locale/es/LC_MESSAGES/djangojs.mo ___________________________________________________________________ Nombre: svn:mime-type + application/octet-stream
1 # SOME DESCRIPTIVE TITLE. 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 # This file is distributed under the same license as the PACKAGE package. 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 5 # 6 #, fuzzy 7 msgid "" 8 msgstr "" 9 "Project-Id-Version: PACKAGE VERSION\n" 10 "Report-Msgid-Bugs-To: \n" 11 "POT-Creation-Date: 2007-09-15 16:45+0200\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n" 15 "MIME-Version: 1.0\n" 16 "Content-Type: text/plain; charset=UTF-8\n" 17 "Content-Transfer-Encoding: 8bit\n" 18 19 #: media/js/translate.js:1 20 msgid "this is to be translated" 21 msgstr "esto tiene que ser traducido" -
tests/regressiontests/django_views/locale/fr/LC_MESSAGES/djangojs.po
No se puede mostrar: el archivo está marcado como binario. svn:mime-type = application/octet-stream Cambios de propiedades en tests/regressiontests/django_views/locale/fr/LC_MESSAGES/djangojs.mo ___________________________________________________________________ Nombre: svn:mime-type + application/octet-stream
1 # SOME DESCRIPTIVE TITLE. 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 # This file is distributed under the same license as the PACKAGE package. 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 5 # 6 #, fuzzy 7 msgid "" 8 msgstr "" 9 "Project-Id-Version: PACKAGE VERSION\n" 10 "Report-Msgid-Bugs-To: \n" 11 "POT-Creation-Date: 2007-09-15 19:15+0200\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n" 15 "MIME-Version: 1.0\n" 16 "Content-Type: text/plain; charset=UTF-8\n" 17 "Content-Transfer-Encoding: 8bit\n" 18 19 msgid "this is to be translated" 20 msgstr "il faut le traduire" -
tests/regressiontests/django_views/views.py
1 from django.http import HttpResponse 2 from django.template import RequestContext 3 from django.shortcuts import render_to_response 4 5 6 def index_page(request): 7 """ Dummy index page """ 8 return HttpResponse('<html><body>Dummy page</body></html>') 9 10 11 def jsi18n_test(request): 12 """ View for testing javascript message files """ 13 return render_to_response('js_i18n.html', {}) 14 Sin fin-de-línea al final del archivo -
tests/regressiontests/django_views/models.py
1 """ 2 Regression tests for Django Views 3 """ 4 5 from os import path 6 import gettext 7 8 from django.conf import settings 9 from django.test import Client, TestCase 10 from django.contrib.sessions.models import Session 11 from django.utils.translation import activate 12 13 class I18NTests(TestCase): 14 """ Tests django views in django/views/i18n.py """ 15 16 def test_setlang(self): 17 """ Test set_language view """ 18 for lang_code, lang_name in settings.LANGUAGES: 19 response = self.change_language(lang_code, '/django_views/') 20 self.assertRedirects(response, 'http://testserver/django_views/') 21 self.assertEquals(self.client.session['django_language'], lang_code) 22 23 def test_jsi18n(self): 24 """ Test javascript_catalog view """ 25 for lang_code in ['es', 'fr', 'en']: 26 activate(lang_code) 27 locale_dir = path.join(path.dirname(__file__), 'locale') 28 catalog = gettext.translation('djangojs', locale_dir, [lang_code]) 29 trans_txt = catalog.ugettext('this is to be translated') 30 response = self.client.get('/django_views/jsi18n/') 31 # in response content must to be a line like that: 32 # catalog['this is to be translated'] = 'same_that_trans_txt' 33 self.assertContains(response, trans_txt, 1) 34 35 def change_language(self, language, next): 36 post_data = dict(language=language, next=next) 37 return self.client.post('/django_views/i18n/setlang/', data=post_data) -
tests/regressiontests/django_views/urls.py
1 from django.conf.urls.defaults import * 2 import views 3 4 js_info_dict = { 5 'domain': 'djangojs', 6 'packages': ('regressiontests.django_views',), 7 } 8 9 urlpatterns = patterns('', 10 (r'^$', views.index_page), 11 (r'^i18n/', include('django.conf.urls.i18n')), 12 (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), 13 (r'^jsi18n_test/$', views.jsi18n_test), 14 ) -
tests/urls.py
11 11 12 12 # test urlconf for {% url %} template tag 13 13 (r'^url_tag/', include('regressiontests.templates.urls')), 14 15 # django views tests urls 16 (r'^django_views/', include('regressiontests.django_views.urls')), 14 17 ) -
tests/runtests.py
132 132 except Exception, e: 133 133 sys.stderr.write("Error while importing %s:" % model_name + ''.join(traceback.format_exception(*sys.exc_info())[1:])) 134 134 continue 135 136 135 # Add tests for invalid models. 137 136 extra_tests = [] 138 137 for model_dir, model_name in get_invalid_models(): -
tests/templates/js_i18n.html
1 {% extends "base.html" %} 2 {% load i18n %} 3 {% block title %}{% trans "Js Tests" %}{% endblock %} 4 {% block content %} 5 6 {% endblock %} -
AUTHORS
257 257 Brian Rosner <brosner@gmail.com> 258 258 Oliver Rutherfurd <http://rutherfurd.net/> 259 259 ryankanno 260 Manuel Saelices <msaelices@yaco.es> 260 261 Ivan Sagalaev (Maniac) <http://www.softwaremaniacs.org/> 261 262 Vinay Sajip <vinay_sajip@yahoo.co.uk> 262 263 David Schein