From a73243f30b995a36c35a4730b259a6d0d071ea42 Mon Sep 17 00:00:00 2001 From: Marco Bonetti Date: Sun, 15 Apr 2012 09:02:06 +0200 Subject: [PATCH] added a test project to run tests --- CHANGES | 1 + MANIFEST.in | 1 + rosetta/locale/fr/LC_MESSAGES/django.mo | Bin 3218 -> 3034 bytes rosetta/locale/fr/LC_MESSAGES/django.po | 20 +++++---- runtests.sh | 5 +++ testproject/__init__.py | 0 testproject/manage.py | 16 ++++++++ testproject/settings.py | 52 ++++++++++++++++++++++++ testproject/urls.py | 17 ++++++++ 9 files changed, 103 insertions(+), 9 deletions(-) create mode 100644 runtests.sh create mode 100644 testproject/__init__.py create mode 100644 testproject/manage.py create mode 100644 testproject/settings.py create mode 100644 testproject/urls.py diff --git a/CHANGES b/CHANGES index 234f6c9..169d589 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,4 @@ +* Added a testproject to run tests * Merged @sleepyjames' PR that fixes an error when pofile save path contains '.po' in the path * Merged @rory's PR to correcty handle plural strings that have a leading/trailing newline (Issue #34) diff --git a/MANIFEST.in b/MANIFEST.in index 5992110..4166b83 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,3 +3,4 @@ include LICENSE recursive-include rosetta/locale * recursive-include rosetta/tests * recursive-include rosetta/templates * +prune testproject diff --git a/rosetta/locale/fr/LC_MESSAGES/django.mo b/rosetta/locale/fr/LC_MESSAGES/django.mo index b4a11a5a899ee9a78f498defec6ad91162a900b1..646f01a7592d6ccebf4f47ebe45ce83e0726da3b 100644 GIT binary patch delta 659 zcmXxgPbhS*~07@#3RGbkTe#A;kA)>~Ld zoyBcDF82FLYoqpKD~7NP*RTpVa2K=Kg?6TrfhMsAg9iRzg6Cp6fMsT(szn`Vm*3=5%Xrm(AJdb$Lt^;bcmiN`zy{XgC#5cx}V6cx-tgo=)1P glaYkY7yhq@($qbv=v;2L{KzoS<1rOdHDg5o3;h~SasU7T delta 845 zcmXxiPe>GD7{~D^S9fajPo}n+T5G1!VYb~x(v>|}5g3J}=%rIj9a3}!T@bnq6jVg8 z>d-+!JcuCTCDvo&p+ko*fj3Xm$zvdh(#7v@93S?b&pz+If1laC_(Jnsqj%rTauqy? zV;sN}yo-+_W_)a%$7L+wMSK_LAFzqMgq664J-C5Y_!nb%fZE~^HSP$n;{S+w!Gg8) zYN0r40~c%YL6|?mdh$Um;j6I!AGVX9U>mluYZS9sgZ(&Cmkm%T?-%8n zk1raS#yDn?u{MOd@k`Xg6R3*JhQEKr>*OWe!FAMu-ZJ9rv&c zy|2vDhGlHPAE<-;!4*6}E%3S8jDiHGXKoN0r)nrve%)L_(X5fCd5YUKz20j|!q98u z;$y*kXeH6<6nbw8_6tgMGswD$lV(iNIBRejRpu5=CD)}C{*cq@4?7+H zl2c#)R2zNz6MLSYDY_%m`NGUZzBo1Amw5PQa;y+Ob9p8G!87@K UYSQ0`u2yv?haYFkFPtxxr`vu}_W%F@ diff --git a/rosetta/locale/fr/LC_MESSAGES/django.po b/rosetta/locale/fr/LC_MESSAGES/django.po index 1728efa..1176629 100644 --- a/rosetta/locale/fr/LC_MESSAGES/django.po +++ b/rosetta/locale/fr/LC_MESSAGES/django.po @@ -2,19 +2,19 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# msgid "" msgstr "" "Project-Id-Version: Rosetta\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-07-04 13:42+0200\n" -"PO-Revision-Date: 2008-09-22 11:02\n" -"Last-Translator: Admin Admin \n" +"PO-Revision-Date: 2012-03-31 02:17\n" +"Last-Translator: Anonymous User \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Translated-Using: django-rosetta 0.4.RC2\n" +"X-Translated-Using: django-rosetta 0.6.7\n" #: templates/rosetta/languages.html:4 templates/rosetta/languages.html.py:6 msgid "Language selection" @@ -69,8 +69,9 @@ msgstr "" #: templates/rosetta/languages.html:46 #, python-format msgid "" -"Please refer to Django's I18N documentation for a guide on how to set up internationalization for your project." +"Please refer to Django's I18N " +"documentation for a guide on how to set up internationalization for your" +" project." msgstr "" "Veuillez vous référer à la documentation sur " "l'internationalisation de Django pour un guide sur comment activer et " @@ -97,9 +98,10 @@ msgstr "" msgid "" "Some items in your last translation block couldn't be saved: this usually " "happens when the catalog file changes on disk after you last loaded it." -msgstr "Certains parmi vos derniers éléments n'ont pas pu être sauvés: ceci " -"arrive généralement quand le catalogue de traductions à été modifié après qu'il ait " -"été chargé." +msgstr "" +"Certains parmi vos derniers éléments n'ont pas pu être sauvés: ceci arrive " +"généralement quand le catalogue de traductions à été modifié après qu'il ait" +" été chargé." #: templates/rosetta/pofile.html:28 #, python-format diff --git a/runtests.sh b/runtests.sh new file mode 100644 index 0000000..83fe4d0 --- /dev/null +++ b/runtests.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd testproject +python manage.py test rosetta +cd .. diff --git a/testproject/__init__.py b/testproject/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testproject/manage.py b/testproject/manage.py new file mode 100644 index 0000000..e3c8477 --- /dev/null +++ b/testproject/manage.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +import sys +import os + +try: + import settings # Assumed to be in the same directory. +except ImportError: + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +sys.path.insert(0, BASEDIR) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/testproject/settings.py b/testproject/settings.py new file mode 100644 index 0000000..b47307d --- /dev/null +++ b/testproject/settings.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +import django +import os +import sys + +SITE_ID = 1 + +PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) + +PYTHON_VERSION = '%s.%s' % sys.version_info[:2] +DJANGO_VERSION = django.get_version() + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(PROJECT_PATH, 'rosetta.db') + } +} + +TEST_DATABASE_CHARSET = "utf8" +TEST_DATABASE_COLLATION = "utf8_general_ci" + +DATABASE_SUPPORTS_TRANSACTIONS = True + +INSTALLED_APPS = [ + 'django.contrib.auth', + 'django.contrib.admin', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + + 'rosetta', +] + +LANGUAGE_CODE = "en" + +LANGUAGES = ( + ('en', 'English'), + ('ja', u'日本語'), + ('xx', u'XXXXX'), +) + +SOUTH_TESTS_MIGRATE = False + +FIXTURE_DIRS = ( + os.path.join(PROJECT_PATH, 'fixtures'), +) + +ROOT_URLCONF = 'testproject.urls' + +DEBUG = True +TEMPLATE_DEBUG = True diff --git a/testproject/urls.py b/testproject/urls.py new file mode 100644 index 0000000..039e61a --- /dev/null +++ b/testproject/urls.py @@ -0,0 +1,17 @@ +from django.conf.urls.defaults import patterns, include, url + +# Uncomment the next two lines to enable the admin: +# from django.contrib import admin +# admin.autodiscover() + +urlpatterns = patterns('', + # Examples: + # url(r'^$', 'testproject.views.home', name='home'), + # url(r'^testproject/', include('testproject.foo.urls')), + + # Uncomment the admin/doc line below to enable admin documentation: + # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line to enable the admin: + # url(r'^admin/', include(admin.site.urls)), +)