forked from django-cms/django-cms
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:divio/django-cms into develop
- Loading branch information
Showing
9 changed files
with
146 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
!.travis.yml | ||
*.swp | ||
*.lock | ||
*.log | ||
*.pid | ||
cms/django | ||
*.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% load cms_tags sekizai_tags %} | ||
{% render_block "css" %} | ||
{% cms_toolbar %} | ||
{% placeholder "placeholder" %} | ||
{% render_block "js" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
from cms.api import create_page | ||
from django.contrib.auth.models import User | ||
from django.utils.unittest.case import SkipTest, skipIf | ||
|
||
try: | ||
from selenium.webdriver.firefox.webdriver import WebDriver | ||
from selenium.common.exceptions import NoSuchElementException | ||
from django.test import LiveServerTestCase | ||
except ImportError: | ||
from django.test import TestCase as LiveServerTestCase | ||
WebDriver = NoSuchElementException = False | ||
|
||
|
||
class CMSLiveTests(LiveServerTestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
if WebDriver: | ||
cls.selenium = WebDriver() | ||
super(CMSLiveTests, cls).setUpClass() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
if hasattr(cls, 'selenium'): | ||
cls.selenium.quit() | ||
super(CMSLiveTests, cls).tearDownClass() | ||
|
||
|
||
|
||
class ToolbarBasicTests(CMSLiveTests): | ||
@skipIf(not WebDriver, 'Selenium not found or Django too old') | ||
def test_toolbar_login(self): | ||
create_page('Home', 'simple.html', 'en', published=True).publish() | ||
user = User() | ||
user.username = 'admin' | ||
user.set_password('admin') | ||
user.is_superuser = user.is_staff = user.is_active = True | ||
user.save() | ||
url = '%s/?edit' % self.live_server_url | ||
self.selenium.get(url) | ||
self.assertRaises(NoSuchElementException, self.selenium.find_element_by_class_name, 'cms_toolbar-item_logout') | ||
self.selenium.find_element_by_class_name('cms_toolbar_icon-toggle').click() | ||
username_input = self.selenium.find_element_by_id("cms_toolbar-item_login-username") | ||
username_input.send_keys('admin') | ||
password_input = self.selenium.find_element_by_id("cms_toolbar-item_login-password") | ||
password_input.send_keys('admin') | ||
password_input.submit() | ||
self.assertTrue(self.selenium.find_element_by_class_name('cms_toolbar-item_logout')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-r django-1.4.txt | ||
selenium |