Skip to content
Browse files

Merge remote branch 'upstream/develop' into feature-moderation

Conflicts:
	cms/tests/page.py
	cms/utils/moderator.py
  • Loading branch information...
2 parents fc636b5 + 014068b commit 6a4f1f9e73bcec9159726ddfd0abdc27aae6cf8e @adaptivelogic adaptivelogic committed Nov 13, 2012
View
5 AUTHORS
@@ -33,10 +33,12 @@ Contributors (in alphabetical order):
* Andrew Cassidy
* Andrew Schoen
* angular_circle
+* Anton Parkhomenko
* Antoni Aloy López
* Arne Gellhaus
* Artem Skoretskiy
* Arthur Debert
+* Aymeric Augustin
* Batiste Bieler
* behrooz
* Behrooz Nobakht
@@ -68,6 +70,7 @@ Contributors (in alphabetical order):
* eged
* Egor V. Nazarkin
* Ekrem Seren
+* Erlend Dalen
* Eric Eldredge
* Erik Allik
* Eugen MechanisM
@@ -170,6 +173,7 @@ Contributors (in alphabetical order):
* Rebecca Breu
* Remco Wendt
* Restless Being
+* Richard Barran
* Robert Buchholz
* Robert Clark
* Robert Pogorzelski
@@ -204,6 +208,7 @@ Contributors (in alphabetical order):
* tiret
* Ulrich Petri
* Vasil Vangelovski
+* Viliam Segeda
* wangJunjie
* Wayne Moore
* wid
View
12 CHANGELOG.txt
@@ -110,6 +110,14 @@
- fixed an incompatibility with Python 2.5
+==== 2.3.4 (2012-11-09) ====
+
+- Fixed WymEditor
+- Fixed Norwegian translations
+- Fixed a bug that could lead to slug clashes
+- Fixed page change form (jQuery and permissions)
+- Fixed placeholder field permission checks
+
==== 2.4.0 ===-
- CMS_LANGUAGE setting has changed
@@ -122,7 +130,3 @@
- CMS_FLAT_URLS has been removed
-
-
-
-
View
2 cms/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-__version__ = '2.3.3.post0'
+__version__ = '2.3.4.post0'
# patch settings
try:
View
41 cms/locale/it/LC_MESSAGES/django.po
@@ -6,16 +6,17 @@
# babu <marco.badan@gmail.com>, 2011.
# Denis Darii <sinednx@gmail.com>, 2011.
# Iacopo Spalletti <i.spalletti@nephila.it>, 2011.
+# <i.spalletti@nephila.it>, 2012.
# karim79 <karim@gorjux.net>, 2011.
# Marco Barberis <mbarberis@gmail.com>, 2011.
# <sbrentegani@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: django-cms\n"
"Report-Msgid-Bugs-To: https://github.com/divio/django-cms/issues\n"
-"POT-Creation-Date: 2012-09-19 14:44+0200\n"
-"PO-Revision-Date: 2012-09-19 14:44+0000\n"
-"Last-Translator: Patrick Lauber <patrick.lauber@divio.ch>\n"
+"POT-Creation-Date: 2012-09-21 14:52+0200\n"
+"PO-Revision-Date: 2012-11-09 15:24+0000\n"
+"Last-Translator: yakky <i.spalletti@nephila.it>\n"
"Language-Team: divio.ch <developers@divio.ch>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -287,7 +288,7 @@ msgstr "Errore del database"
#: admin/pageadmin.py:779
msgid ""
"Error! You don't have permissions to move this page. Please reload the page"
-msgstr ""
+msgstr "Errore! Non hai il permesso di spostare questa pagina. Ricarica la pagina"
#: admin/pageadmin.py:880
msgid "Page was successfully approved."
@@ -922,15 +923,15 @@ msgstr "Google Map"
#: plugins/googlemap/cms_plugins.py:19
msgid "Advanced"
-msgstr ""
+msgstr "Avanzato"
#: plugins/googlemap/forms.py:23
msgid "Must be a positive integer followed by “px” or “%”."
-msgstr ""
+msgstr "Deve essere un intero seguito da “px” o \"%\""
#: plugins/googlemap/forms.py:26
msgid "Must be a positive integer followed by “px”."
-msgstr ""
+msgstr "Deve essere un intero seguito da “px”."
#: plugins/googlemap/models.py:10
msgid "map title"
@@ -954,7 +955,7 @@ msgstr "contenuti aggiuntivi"
#: plugins/googlemap/models.py:19
msgid "Displayed under address in the bubble."
-msgstr ""
+msgstr "Mostrato sotto l'indirizzo nel fumetto."
#: plugins/googlemap/models.py:21
msgid "zoom level"
@@ -986,11 +987,11 @@ msgstr "route planer"
#: plugins/googlemap/models.py:37
msgid "Plugin width (in pixels or percent)."
-msgstr ""
+msgstr "Larghezza del plugin (in pixel o percentuale)."
#: plugins/googlemap/models.py:39
msgid "Plugin height (in pixels)."
-msgstr ""
+msgstr "Altezza del plugin (in pixel)."
#: plugins/googlemap/models.py:47
msgid "Map"
@@ -1053,23 +1054,23 @@ msgstr "Un indirizzo email ha priorità rispetto a un link testuale."
#: plugins/link/models.py:14
msgid "target"
-msgstr ""
+msgstr "target"
#: plugins/link/models.py:15
msgid "same window"
-msgstr ""
+msgstr "stessa finestra"
#: plugins/link/models.py:16
msgid "new window"
-msgstr ""
+msgstr "nuova finestra"
#: plugins/link/models.py:17
msgid "parent window"
-msgstr ""
+msgstr "finestra superiore"
#: plugins/link/models.py:18
msgid "topmost frame"
-msgstr ""
+msgstr "finestra principale"
#: plugins/picture/cms_plugins.py:9
msgid "Picture"
@@ -1730,7 +1731,7 @@ msgstr "Una versione precedente di un plugin non può essere salvata!"
#: templates/admin/cms/page/plugin_forms_ok.html:26
msgid "Your changes to this plugin have not been saved."
-msgstr ""
+msgstr "Le tue modifiche al plugin non sono state salvate."
#: templates/admin/cms/page/plugin_forms_ok.html:26
msgid "Plugin saved successfully."
@@ -1906,11 +1907,11 @@ msgstr "colonna a destra"
#: test_utils/project/placeholderapp/cms_plugins.py:7
msgid "Test Plugin"
-msgstr ""
+msgstr "Plugin Test"
#: test_utils/project/pluginapp/plugins/extra_context/cms_plugins.py:9
msgid "Extra Context"
-msgstr ""
+msgstr "Context aggiuntivo"
#: test_utils/project/pluginapp/plugins/manytomany_rel/cms_plugins.py:13
msgid "Articles"
@@ -1976,8 +1977,8 @@ msgid ""
msgid_plural ""
"Pages %(pages)s have the same url '%(url)s' as current page "
"\"%(instance)s\"."
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "La pagina %(pages)s ha lo stesso url '%(url)s' della pagina corrente \"%(instance)s\"."
+msgstr[1] "Le pagine %(pages)s hanno lo stesso url '%(url)s' della pagina corrente \"%(instance)s\"."
#~ msgid "move"
#~ msgstr "move request"
View
0 cms/locale/no/LC_MESSAGES/django.mo → cms/locale/nb/LC_MESSAGES/django.mo
File renamed without changes.
View
2 cms/locale/no/LC_MESSAGES/django.po → cms/locale/nb/LC_MESSAGES/django.po
@@ -13,10 +13,10 @@ msgstr ""
"PO-Revision-Date: 2012-09-19 14:44+0000\n"
"Last-Translator: Patrick Lauber <patrick.lauber@divio.ch>\n"
"Language-Team: divio.ch <developers@divio.ch>\n"
+"Language: nb\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: no\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Country: SWITZERLAND\n"
"X-Poedit-Language: English\n"
View
0 cms/locale/no/LC_MESSAGES/djangojs.mo → cms/locale/nb/LC_MESSAGES/djangojs.mo
File renamed without changes.
View
1 cms/locale/no/LC_MESSAGES/djangojs.po → cms/locale/nb/LC_MESSAGES/djangojs.po
@@ -15,7 +15,6 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: no\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: static/cms/js/change_form.js:31
View
4 cms/models/pagemodel.py
@@ -7,9 +7,9 @@
from cms.models.pluginmodel import CMSPlugin
from cms.publisher.errors import MpttPublisherCantPublish
from cms.utils import i18n, urlutils, page as page_utils
+from cms.utils import timezone
from cms.utils.copy_plugins import copy_plugins_to
from cms.utils.helpers import reversion_register
-from datetime import datetime
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
@@ -342,7 +342,7 @@ def save(self, no_signals=False, commit=True, **kwargs):
# Published pages should always have a publication date
# if the page is published we set the publish date if not set yet.
if self.publication_date is None and self.published:
- self.publication_date = datetime.now()
+ self.publication_date = timezone.now()
if self.reverse_id == "":
self.reverse_id = None
View
7 cms/models/pluginmodel.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os
import warnings
-from datetime import datetime, date
+from datetime import date
from django.conf import settings
from django.core.exceptions import ValidationError, ObjectDoesNotExist
@@ -14,6 +14,7 @@
from cms.models.placeholdermodel import Placeholder
from cms.plugin_rendering import PluginContext, render_plugin
from cms.utils.helpers import reversion_register
+from cms.utils import timezone
from mptt.models import MPTTModel, MPTTModelBase
@@ -81,13 +82,13 @@ class CMSPlugin(MPTTModel):
position = models.PositiveSmallIntegerField(_("position"), blank=True, null=True, editable=False)
language = models.CharField(_("language"), max_length=15, blank=False, db_index=True, editable=False)
plugin_type = models.CharField(_("plugin_name"), max_length=50, db_index=True, editable=False)
- creation_date = models.DateTimeField(_("creation date"), editable=False, default=datetime.now)
+ creation_date = models.DateTimeField(_("creation date"), editable=False, default=timezone.now)
changed_date = models.DateTimeField(auto_now=True)
level = models.PositiveIntegerField(db_index=True, editable=False)
lft = models.PositiveIntegerField(db_index=True, editable=False)
rght = models.PositiveIntegerField(db_index=True, editable=False)
tree_id = models.PositiveIntegerField(db_index=True, editable=False)
- child_plugins_instances = None
+ child_plugin_instances = None
class Meta:
app_label = 'cms'
View
7 cms/models/query.py
@@ -5,6 +5,7 @@
from cms.publisher.query import PublisherQuerySet
from django.conf import settings
from cms.exceptions import NoHomeFound
+from cms.utils import timezone
class PageQuerySet(PublisherQuerySet):
@@ -51,21 +52,21 @@ def published(self, site=None):
if settings.CMS_SHOW_START_DATE:
pub = pub.filter(
- Q(publication_date__lt=datetime.now()) |
+ Q(publication_date__lt=timezone.now()) |
Q(publication_date__isnull=True)
)
if settings.CMS_SHOW_END_DATE:
pub = pub.filter(
- Q(publication_end_date__gte=datetime.now()) |
+ Q(publication_end_date__gte=timezone.now()) |
Q(publication_end_date__isnull=True)
)
return pub
def expired(self):
return self.on_site().filter(
- publication_end_date__lte=datetime.now())
+ publication_end_date__lte=timezone.now())
# - seems this is not used anymore...
# def get_pages_with_application(self, path, language):
View
4 cms/models/titlemodels.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
-from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models.managers import TitleManager
from cms.models.pagemodel import Page
from cms.utils.helpers import reversion_register
+from cms.utils import timezone
class Title(models.Model):
@@ -20,7 +20,7 @@ class Title(models.Model):
meta_keywords = models.CharField(_("keywords"), max_length=255, blank=True, null=True)
page_title = models.CharField(_("title"), max_length=255, blank=True, null=True, help_text=_("overwrite the title (html title tag)"))
page = models.ForeignKey(Page, verbose_name=_("page"), related_name="title_set")
- creation_date = models.DateTimeField(_("creation date"), editable=False, default=datetime.now)
+ creation_date = models.DateTimeField(_("creation date"), editable=False, default=timezone.now)
objects = TitleManager()
View
2 cms/static/cms/css/pages.css
@@ -131,7 +131,7 @@ a.collapsed span.collapsed{
}
.ac_loading {
- background: white url('../indicator.gif') right center no-repeat;
+ background: white url('../images/indicator.gif') right center no-repeat;
}
.ac_odd {
View
38 cms/static/cms/js/plugins/cms.placeholders.js
@@ -218,7 +218,6 @@ CMS.$(document).ready(function ($) {
// add array to new position
if(dir === 'moveup') array.splice(index-1, 0, values.plugin_id);
if(dir === 'movedown') array.splice(index+1, 0, values.plugin_id);
-
// now lets do the ajax request
$.ajax({
'type': 'POST',
@@ -232,12 +231,39 @@ CMS.$(document).ready(function ($) {
// lets refresh the elements in the dom as well
function refreshPluginPosition() {
- if(dir === 'moveup' && index !== bound+1) plugin.insertBefore($(holders[index-1]));
- if(dir === 'movedown' && index !== -1) plugin.insertAfter($(holders[index+1]));
+ var target;
+ var before = false;
+ if(dir === 'moveup' && index !== bound+1){
+ before = true;
+ target = $(holders[index-1]);
+ }
+ if(dir === 'movedown' && index !== -1){
+ target = $(holders[index+1]);
+ }
// move in or out of boundary
- if(dir === 'moveup' && index === bound+1) plugin.insertAfter($(holders[index-2]));
- if(dir === 'movedown' && index === -1) plugin.insertBefore($(holders[index+1]));
-
+ if(dir === 'moveup' && index === bound+1){
+ target = $(holders[index-2]);
+ }
+ if(dir === 'movedown' && index === -1){
+ target = $(holders[index+1]);
+ before = true;
+ }
+ var target_id = target.attr('id').split("-")[1];
+ if(before){
+ plugin.insertBefore(target);
+ }else{
+ var target_content = $("#cms_placeholdercontent-"+target_id);
+ if(target_content.length > 0){
+ plugin.insertAfter(target_content);
+ }else{
+ plugin.insertAfter(target);
+ }
+ }
+ var content = $("#cms_placeholdercontent-"+values.plugin_id);
+ if(content.length > 0){
+ content.insertAfter($("#cms_placeholder-"+values.plugin_id));
+ }
+
// close overlay
that.hideOverlay();
View
2 cms/static/cms/js/wymeditor/skins/django/skin.css
@@ -135,4 +135,4 @@
/* End hide from IE-mac */
/*WYMEDITOR_LINK*/
- a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; }
+ a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../../../../wymeditor/skins/wymeditor_icon.png); overflow: hidden; text-decoration: none; }
View
2 cms/templates/cms/toolbar/placeholder_wrapper.html
@@ -27,4 +27,4 @@
</script>
{% endaddtoblock %}
<div id="cms_placeholder-{{ instance.pk }}" class="cms_placeholder cms_placeholder_slot::{{ instance.placeholder.slot }}">{% if instance.get_plugin_class.allow_children %}{{ instance.get_plugin_class.name }}{% else %}{{ rendered_content }}{% endif %}</div>
-{% if instance.get_plugin_class.allow_children %}{{ rendered_content }}{% endif %}
+{% if instance.get_plugin_class.allow_children %}<div id="cms_placeholdercontent-{{ instance.pk }}">{{ rendered_content }}</div>{% endif %}
View
3 cms/tests/__init__.py
@@ -23,11 +23,12 @@
from cms.tests.security import *
from cms.tests.settings import *
from cms.tests.site import *
+from cms.tests.staticfiles import *
from cms.tests.templatetags import *
from cms.tests.toolbar import *
from cms.tests.urlutils import *
from cms.tests.views import *
from cms.tests.management import *
from cms.tests.menu_page_viewperm import *
from cms.tests.menu_page_viewperm_staff import *
-from cms.tests.nested_plugins import *
+from cms.tests.nested_plugins import *
View
7 cms/tests/page.py
@@ -24,6 +24,7 @@
from cms.test_utils.util.context_managers import (LanguageOverride,
SettingsOverride)
from cms.utils.page_resolver import get_page_from_request, is_valid_url
+from cms.utils import timezone
from cms.utils.page import is_valid_page_slug
class PagesTestCase(CMSTestCase):
@@ -389,7 +390,7 @@ def test_sitemap_login_required_pages(self):
self.assertEqual(CMSSitemap().items().count(),0)
def test_sitemap_includes_last_modification_date(self):
- one_day_ago = datetime.datetime.now() - datetime.timedelta(days=1)
+ one_day_ago = timezone.now() - datetime.timedelta(days=1)
page = create_page("page", "nav_playground.html", "en", published=True, publication_date=one_day_ago)
page.creation_date = one_day_ago
page.save()
@@ -399,7 +400,7 @@ def test_sitemap_includes_last_modification_date(self):
self.assertTrue(actual_last_modification_time > one_day_ago)
def test_sitemap_uses_publication_date_when_later_than_modification(self):
- now = datetime.datetime.now()
+ now = timezone.now()
one_day_ago = now - datetime.timedelta(days=1)
page = create_page("page", "nav_playground.html", "en", published=True, publication_date=now)
page.creation_date = one_day_ago
@@ -577,7 +578,7 @@ def test_page_already_expired(self):
Test that a page which has a end date in the past gives a 404, not a
500.
"""
- yesterday = datetime.date.today() - datetime.timedelta(days=1)
+ yesterday = timezone.now() - datetime.timedelta(days=1)
with SettingsOverride(CMS_PERMISSION=False):
page = create_page('page', 'nav_playground.html', 'en',
publication_end_date=yesterday, published=True)
View
3 cms/tests/plugins.py
@@ -24,6 +24,7 @@
from cms.sitemaps.cms_sitemap import CMSSitemap
from cms.test_utils.util.context_managers import SettingsOverride
from cms.utils.copy_plugins import copy_plugins_to
+from cms.utils import timezone
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import User
@@ -657,7 +658,7 @@ def test_empty_plugin_is_ignored(self):
self.assertFalse(len(placeholder._en_plugins_cache))
def test_editing_plugin_changes_page_modification_time_in_sitemap(self):
- now = datetime.datetime.now()
+ now = timezone.now()
one_day_ago = now - datetime.timedelta(days=1)
page = create_page("page", "nav_playground.html", "en", published=True, publication_date=now)
page.creation_date = one_day_ago
View
22 cms/tests/staticfiles.py
@@ -0,0 +1,22 @@
+from __future__ import with_statement
+from cms.test_utils.compat import skipIf
+from cms.test_utils.util.context_managers import SettingsOverride, StdoutOverride, TemporaryDirectory
+import django
+from django.core import management
+from django.test import TestCase
+from distutils.version import LooseVersion
+
+
+class StaticFilesTest(TestCase):
+
+ @skipIf(LooseVersion(django.get_version()) < LooseVersion('1.4'),
+ "CachedStaticFilesStorage doesn't exist in Django < 1.4")
+ def test_collectstatic_with_cached_static_files_storage(self):
+ # CachedStaticFilesStorage requires that the CSS files
+ # don't contain any broken links.
+ with TemporaryDirectory() as tmpdir:
+ with SettingsOverride(STATIC_ROOT=tmpdir,
+ STATICFILES_STORAGE='django.contrib.staticfiles.storage.CachedStaticFilesStorage'):
+ with StdoutOverride() as output:
+ management.call_command('collectstatic', interactive=False)
+
View
4 cms/utils/moderator.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import datetime
-from django.utils.translation import ugettext as _
from cms.models import Page, PageModeratorState, CMSPlugin, Title
+from cms.utils import timezone
def page_changed(page, old_page=None, force_moderation_action=None):
@@ -39,7 +39,7 @@ def update_moderation_message(page, message):
from cms.utils.permissions import get_current_user
user = get_current_user()
- created = datetime.datetime.now() - datetime.timedelta(seconds=UPDATE_TOLERANCE)
+ created = timezone.now() - datetime.timedelta(seconds=UPDATE_TOLERANCE)
try:
state = page.pagemoderatorstate_set.filter(user=user, created__gt=created).order_by('-created')[0]
except IndexError:
View
47 cms/utils/timezone.py
@@ -0,0 +1,47 @@
+# This file is a partial copy of django.utils.timezone as of Django 1.4.
+# It must be removed as soon as django-cms drops support for Django 1.3.
+# All imports of cms.utils.timezone must be replaced by django.utils.timezone.
+
+from datetime import datetime, timedelta, tzinfo
+from threading import local
+
+try:
+ import pytz
+except ImportError:
+ pytz = None
+
+from django.conf import settings
+
+ZERO = timedelta(0)
+
+class UTC(tzinfo):
+ """
+ UTC implementation taken from Python's docs.
+
+ Used only when pytz isn't available.
+ """
+
+ def __repr__(self):
+ return "<UTC>"
+
+ def utcoffset(self, dt):
+ return ZERO
+
+ def tzname(self, dt):
+ return "UTC"
+
+ def dst(self, dt):
+ return ZERO
+
+utc = pytz.utc if pytz else UTC()
+"""UTC time zone as a tzinfo instance."""
+
+def now():
+ """
+ Returns an aware or naive datetime.datetime, depending on settings.USE_TZ.
+ """
+ if getattr(settings, 'USE_TZ', False):
+ # timeit shows that datetime.now(tz=utc) is 24% slower
+ return datetime.utcnow().replace(tzinfo=utc)
+ else:
+ return datetime.now()
View
1 docs/index.rst
@@ -25,6 +25,7 @@ Install
getting_started/installation
upgrade/2.4
+ upgrade/2.3.4
upgrade/2.3.3
upgrade/2.3.2
upgrade/2.3
View
53 docs/upgrade/2.3.4.rst
@@ -0,0 +1,53 @@
+###################
+2.3.4 release notes
+###################
+
+*******************
+What's new in 2.3.4
+*******************
+
+WymEditor fixed
+===============
+
+2.3.4 fixes a critical issue with WymEditor that prevented it from load it's
+JavaScript assets correctly.
+
+Moved Norwegian translations
+============================
+
+The Norwegian translations are now available as ``nb``, which is the new
+(since 2003) official language code for Norwegian, replacing the older and
+deprecated ``no`` code.
+
+If your site runs in Norwegian, you need to change your ``LANGUAGES`` settings!
+
+Added support for timezones
+===========================
+
+On Django 1.4, and with ``USE_TZ=True`` the django CMS now uses timezone aware
+date and time objects.
+
+Fixed slug clashing
+===================
+
+In earlier versions, publishing a page that has the same slug (URL) as another
+(published) page could lead to errors. Now, when a page which would have the
+same URL as another (published) page is published, the user is shown an error
+and they're prompted to change the slug for the page.
+
+Prevent unnamed related names for PlaceholderField
+==================================================
+
+:class:`cms.models.fields.PlaceholderField` no longer allows the related name
+to be suppressed. Trying to do so will lead to a :exc:`ValueError`. This change
+was done to allow the django CMS to properly check permissions on Placeholder
+Fields.
+
+Two fixes to page change form
+=============================
+
+The change form for pages would throw errors if the user editing the page does
+not have the permission to publish this page. This issue was resolved.
+
+Further the page change form would not correctly pre-popluate the slug field if
+``DEBUG`` was set to ``False``. Again, this issue is now resolved.
View
9 runtests.py
@@ -2,8 +2,10 @@
from __future__ import with_statement
from cms.test_utils.cli import configure
from cms.test_utils.tmpdir import temp_dir
+from django import VERSION
import argparse
import sys
+import warnings
def main(test_runner='cms.test_utils.runners.NormalTestRunner', junit_output_dir='.',
@@ -12,9 +14,14 @@ def main(test_runner='cms.test_utils.runners.NormalTestRunner', junit_output_dir
test_labels = ['cms']
with temp_dir() as STATIC_ROOT:
with temp_dir() as MEDIA_ROOT:
+ # Test with time zone support enabled when it's available
+ use_tz = VERSION[:2] >= (1, 4)
+ warnings.filterwarnings(
+ 'error', r"DateTimeField received a naive datetime",
+ RuntimeWarning, r'django\.db\.models\.fields')
configure(TEST_RUNNER=test_runner, JUNIT_OUTPUT_DIR=junit_output_dir,
TIME_TESTS=time_tests, ROOT_URLCONF='cms.test_utils.project.urls',
- STATIC_ROOT=STATIC_ROOT, MEDIA_ROOT=MEDIA_ROOT)
+ STATIC_ROOT=STATIC_ROOT, MEDIA_ROOT=MEDIA_ROOT, USE_TZ=use_tz)
from django.conf import settings
from django.test.utils import get_runner
TestRunner = get_runner(settings)
View
2 test_requirements/django-1.3.txt
@@ -1,4 +1,4 @@
-r requirements_base.txt
-Django==1.3.2
-e git://github.com/digi604/django-i18nurls.git#egg=django-i18nurls
+Django>=1.3,<1.4
django-reversion==1.5.3
View
4 test_requirements/django-1.4.txt
@@ -1,3 +1,3 @@
-r requirements_base.txt
-Django==1.4.1
-django-reversion==1.6.2
+Django>=1.4,<1.5
+django-reversion==1.6
View
4 test_requirements/django-trunk.txt
@@ -1,2 +1,4 @@
-r requirements_base.txt
-https://github.com/django/django/tarball/master/django-cms.tar.gz'
+https://github.com/django/django/tarball/master/django.tar.gz#egg=django
+django-reversion==1.6.2
+

0 comments on commit 6a4f1f9

Please sign in to comment.
Something went wrong with that request. Please try again.