Browse files

fixed tests

  • Loading branch information...
1 parent 5b2ff3a commit fa41c8923a511a7f38e7ef392d7169ca61c4dd0a @digi604 digi604 committed Aug 14, 2012
Showing with 16 additions and 14 deletions.
  1. +16 −14 cms/tests/plugins.py
View
30 cms/tests/plugins.py
@@ -19,7 +19,7 @@
from cms.test_utils.project.pluginapp.plugins.manytomany_rel.models import (
ArticlePluginModel)
from cms.test_utils.testcases import (CMSTestCase, URL_CMS_PAGE,
- URL_CMS_PAGE_ADD, URL_CMS_PLUGIN_ADD, URL_CMS_PLUGIN_EDIT, URL_CMS_PAGE_CHANGE)
+ URL_CMS_PAGE_ADD, URL_CMS_PLUGIN_ADD, URL_CMS_PLUGIN_EDIT, URL_CMS_PAGE_CHANGE, URL_CMS_PLUGIN_REMOVE)
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
@@ -119,7 +119,7 @@ def test_add_edit_plugin(self):
"body":"Hello World!!",
"_cancel":True,
}
- response = self.client.post(edit_url, data)
+ response = self.client.post(URL_CMS_PAGE_ADD, data)
self.assertEquals(response.status_code, 200)
txt = Text.objects.all()[0]
self.assertEquals("Hello World", txt.body)
@@ -595,6 +595,19 @@ def test_empty_plugin_is_ignored(self):
self.assertFalse(len(out))
self.assertFalse(len(placeholder._en_plugins_cache))
+ def test_editing_plugin_changes_page_modification_time_in_sitemap(self):
+ now = datetime.datetime.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
+ page.changed_date = one_day_ago
+
+ plugin_id = self._create_text_plugin_on_page(page)
+ plugin = self._edit_text_plugin(plugin_id, "fnord")
+
+ actual_last_modification_time = CMSSitemap().lastmod(page)
+ self.assertEqual(plugin.changed_date, actual_last_modification_time)
+
class FileSystemPluginTests(PluginsTestBaseCase):
def setUp(self):
@@ -628,18 +641,7 @@ def test_fileplugin_icon_uppercase(self):
self.assertNotEquals(plugin.get_icon_url().find('jpg'), -1)
- def test_editing_plugin_changes_page_modification_time_in_sitemap(self):
- now = datetime.datetime.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
- page.changed_date = one_day_ago
-
- plugin_id = self._create_text_plugin_on_page(page)
- plugin = self._edit_text_plugin(plugin_id, "fnord")
-
- actual_last_modification_time = CMSSitemap().lastmod(page)
- self.assertEqual(plugin.changed_date, actual_last_modification_time)
+
class PluginManyToManyTestCase(PluginsTestBaseCase):

0 comments on commit fa41c89

Please sign in to comment.