Changeset 1453
- Timestamp:
- 28.02.2008 11:39:26 (3 months ago)
- Files:
-
- trunk/dev_scripts/unittests (deleted)
- trunk/pylucid/PyLucid/db_dump_datadir/PyLucid_page.py (modified) (1 diff)
- trunk/pylucid/PyLucid/settings_example.py (modified) (2 diffs)
- trunk/pylucid/tests/crypt.py (copied) (copied from trunk/dev_scripts/unittests/unittest_crypt.py) (6 diffs)
- trunk/pylucid/tests/page_permissions.py (added)
- trunk/pylucid/tests/plugin_backlinks.py (copied) (copied from trunk/dev_scripts/unittests/unittest_plugin_backlinks.py) (8 diffs)
- trunk/pylucid/tests/plugin_main_menu.py (copied) (copied from trunk/dev_scripts/unittests/unittest_plugin_main_menu.py) (9 diffs)
- trunk/pylucid/tests/preferences.py (copied) (copied from trunk/dev_scripts/unittests/unittest_Preferences.py) (9 diffs)
- trunk/pylucid/tests/sha1_js_login.py (copied) (copied from trunk/dev_scripts/unittests/unittest_SHA1_JS_Login.py) (36 diffs)
- trunk/pylucid/tests/unique_shortcuts.py (copied) (copied from trunk/dev_scripts/unittests/unittest_UniqueShortcuts.py) (1 diff)
- trunk/pylucid/tests/urls.py (copied) (copied from trunk/dev_scripts/unittests/unittest_URLs.py) (4 diffs)
- trunk/pylucid/tests/url_patterns.py (copied) (copied from trunk/dev_scripts/unittests/unittest_urls_patterns.py) (9 diffs)
- trunk/pylucid/tests/utils (added)
- trunk/pylucid/tests/utils/BrowserDebug.py (added)
- trunk/pylucid/tests/utils/FakeRequest.py (added)
- trunk/pylucid/tests/utils/__init__.py (added)
- trunk/pylucid/tests/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pylucid/PyLucid/db_dump_datadir/PyLucid_page.py
r1333 r1453 6 6 [1, u'<h2>Welcome to your PyLucid CMS =;-)</h2> \r\n<p>\r\nNote:\r\n</p>\r\n<ul>\r\n\t<li>After install deactivate the _install section!</li> \r\n</ul>\r\n<h3>list of last page updates</h3>\r\n<p>\r\n<a href="{% lucidTag RSSfeedGenerator count="10" %}" type="application/rss+xml" title="page updates">RSS feed</a><br />\r\n{% lucidTag page_update_list %}\r\n</p>\r\n', None, 0, u'index', u'index', u'index', 1, 1, 1, u'', u'', '2007-06-22 09:48:29', '2007-12-04 02:25:55', 1, 1, True, True, None, None] 7 7 [2, u'h2. sub menu\r\n\r\n{% lucidTag sub_menu %}', None, 0, u'example pages', u'ExamplePages', u'example pages', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:48:33', 1, 1, True, True, None, None] 8 [3, u'h1. tinyTextile help\r\n\r\nh1. headlines\r\n\r\nheadlines are introduced with \'h1.\':\r\n\r\n<pre>\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n</pre>\r\n\r\nResult:\r\n\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n\r\n(Important: one blank line under the headline!)\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Text formatting\r\n\r\n<pre>\r\nI am a --small-- word with <small> tag.\r\nThis is a *fat* word with <strong> tag.\r\n</pre>\r\n\r\nResult:\r\n\r\nI am a --small-- word with ==<small>== tag.\r\nThis is a *fat* word with ==<strong>== tag.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Links\r\n\r\nLinks according in the following pattern:\r\n\r\n<pre>"LinkText":URL</pre>\r\n\r\nexamples:\r\n<pre>\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n</pre>\r\n\r\nResult:\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n\r\n<hr class="big_hr">\r\n\r\nh1. List\r\n\r\nYou can make ==<ul>== liste with "*" and ==<ol>== list with "#".\r\nNote: You can\'t mixed this list types ;)\r\n\r\nexamples:\r\n\r\n<pre>\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n</pre>\r\n\r\nResult:\r\n\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Bilder\r\n\r\nEin HTML-img-Tag wird erzeugt, wenn eine Adresse mit einem "!"-Zeichen\r\numschlossen ist.\r\n\r\n<pre>\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n</pre>\r\n\r\nResult:\r\n\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed Python SourceCode\r\n\r\nPut sourcecode between ==<python>== tag. Note: The start and end tag must be located alone in a line!\r\n\r\nexample:\r\n\r\n==\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n==\r\n\r\nResult:\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed source code generally\r\n\r\nWith the ==<code=ext>== Tag you can highlight everything, which offers Pygments.\r\n\'ext\' is the file extension.\r\n\r\nexamples:\r\n\r\n==\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n==\r\n\r\nResult:\r\n\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Escaping\r\n\r\nText inner two "="-chars would be escaped.\r\n\r\nexample:\r\n--------\r\n========\r\nTable: <table width="90%" border="0" align="center">\r\nLink: <a href="URL">txt</a>\r\nInput: <input type="submit" value="preview" />\r\n========\r\n\r\nIt goes also within a flow text:\r\nHere ist no Link: ========<a href="URL">txt</a>======== nice?\r\n\r\n<hr class="big_hr">\r\n\r\nh1. pre-Formarted-Text\r\n\r\nYou can use the ==<pre>== tag. tinyTextile ingnore the Markup in the area.\r\n\r\n<pre>\r\nExample:\r\n---------\r\nh2. Not a textile headline\r\n<h3>Manuelly h3 headline with html tags</h3>\r\n* This is not a...\r\n* ...textile list\r\n</pre>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. HTML-Code\r\n\r\nYou can insert any HTML code directy in you page. tinyTextile ingnore it.', 2, 0, u'tinyTextile example', u'TinyTextileExample', u'complete tinyTextile Formating examples', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:51:45', 1, 5, True, True, None, None]8 [3, u'h1. tinyTextile help\r\n\r\nh1. headlines\r\n\r\nheadlines are introduced with \'h1.\':\r\n\r\n<pre>\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n</pre>\r\n\r\nResult:\r\n\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n\r\n(Important: one blank line under the headline!)\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Text formatting\r\n\r\n<pre>\r\nI am a --small-- word with <small> tag.\r\nThis is a *fat* word with <strong> tag.\r\n</pre>\r\n\r\nResult:\r\n\r\nI am a --small-- word with ==<small>== tag.\r\nThis is a *fat* word with ==<strong>== tag.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Links\r\n\r\nLinks according in the following pattern:\r\n\r\n<pre>"LinkText":URL</pre>\r\n\r\nexamples:\r\n<pre>\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n</pre>\r\n\r\nResult:\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n\r\n<hr class="big_hr">\r\n\r\nh1. List\r\n\r\nYou can make ==<ul>== liste with "*" and ==<ol>== list with "#".\r\nNote: You can\'t mixed this list types ;)\r\n\r\nexamples:\r\n\r\n<pre>\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n</pre>\r\n\r\nResult:\r\n\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Bilder\r\n\r\nEin HTML-img-Tag wird erzeugt, wenn eine Adresse mit einem "!"-Zeichen\r\numschlossen ist.\r\n\r\n<pre>\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n</pre>\r\n\r\nResult:\r\n\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed Python SourceCode\r\n\r\nPut sourcecode between ==<python>== tag. Note: The start and end tag must be located alone in a line!\r\n\r\nexample:\r\n\r\n==\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n==\r\n\r\nResult:\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed source code generally\r\n\r\nWith the ==<code=ext>== Tag you can highlight everything, which offers Pygments.\r\n\'ext\' is the file extension.\r\n\r\nexamples:\r\n\r\n==\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n==\r\n\r\nResult:\r\n\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Escaping\r\n\r\nText inner two "="-chars would be escaped.\r\n\r\nexample:\r\n--------\r\n========\r\nTable: <table width="90%" border="0" align="center">\r\nLink: <a href="URL">txt</a>\r\nInput: <input type="submit" value="preview" />\r\n========\r\n\r\nIt goes also within a flow text:\r\nHere ist no Link: ========<a href="URL">txt</a>======== nice?\r\n\r\n<hr class="big_hr">\r\n\r\nh1. pre-Formarted-Text\r\n\r\nYou can use the ==<pre>== tag. tinyTextile ingnore the Markup in the area.\r\n\r\n<pre>\r\nExample:\r\n---------\r\nh2. Not a textile headline\r\n<h3>Manuelly h3 headline with html tags</h3>\r\n* This is not a...\r\n* ...textile list\r\n</pre>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. HTML-Code\r\n\r\nYou can insert any HTML code directy in you page. tinyTextile ingnore it.', 2, 0, u'tinyTextile example', u'TinyTextileExample', u'complete tinyTextile Formating examples', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:51:45', 1, 1, True, True, None, None] 9 9 [4, u'{% lucidTag SiteMap %}', 2, 5, u'SiteMap', u'SiteMap', u'SiteMap', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:48:33', 1, 1, True, True, None, None] 10 10 [6, u'With this lucidTag you can easy integrade a RSS news feed into your CMS page:\r\n\r\n<code>\r\n{% lucidTag RSS url="http url" title="a feed" %}\r\n</code>\r\n\r\nHere a example:\r\n\r\nh2. PyLucid Project-NEWS RSS feed from sourceforge:\r\n\r\n{% lucidTag RSS url="http://sourceforge.net/export/rss2_projnews.php?group_id=146328&rss_fulltext=1" title="new from sf.net" %}', 2, 0, u'RSS', u'RSS', u'RSS feed test', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:42:29', 1, 1, True, True, None, None] 11 11 [7, u'h2. SourceCode Plugin\r\n\r\nWith the SourceCode Plugin you can integrate the source code of a local file into your CMS page.\r\n\r\nExample Tag:\r\n<pre>{% lucidTag SourceCode url="./media/PyLucid/install_views.css" %}</pre>\r\n\r\nNote: With the ==<code>==-Tag you can directly put highlight source code into your CMS page, look at [[TinyTextileExample]]\r\n\r\nPyLucid used the Python syntax highlighter "Pygments":http://pygments.pocoo.org/ . It supports an ever-growing range of languages, look at: http://pygments.pocoo.org/docs/lexers/\r\n\r\nh3. some Examples:\r\n\r\nh5. ./media/PyLucid/install_views.css:\r\n\r\n{% lucidTag SourceCode url="./media/PyLucid/install_views.css" %}\r\n\r\n\r\n\r\nh5. ./media/PyLucid/shared_sha_tools.js:\r\n\r\n{% lucidTag SourceCode url="./media/PyLucid/shared_sha_tools.js" %}\r\n\r\n\r\n\r\nh2. ==<code>==-Tag\r\n\r\nUse ==<code=ext>...</code>== and PyLucid used Pygments to highlight it.\r\n\'ext\' is the typical fileextension/alias, please look at:\r\n\r\n * http://pygments.pocoo.org/docs/lexers/\r\n\r\nh3. examples\r\n\r\n==<code=css>\r\n.xs {font-family:verdana,arial,helvetica,sans-serif;font-size: x-small}\r\n.m {font-size: medium}\r\n</code>==\r\n\r\nresult:\r\n\r\n<code=css>\r\n.xs {font-family:verdana,arial,helvetica,sans-serif;font-size: x-small}\r\n.m {font-size: medium}\r\n</code>\r\n\r\nHere a "error" example:\r\n\r\n<code=NotExists>\r\nThis is a code with an unknown format!\r\n\r\nIf there exist no Lexer for the given format, PyLucid used the Pygments TextLexer.\r\nSo you can make <code=.xy>...</code>, where .xy is any externsion. But for all that it is well displayed through Pygments. Is that cool?\r\n\r\n=;-)\r\n</code>', 2, 0, u'SourceCode', u'SourceCode', u'SourceCode', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:44:26', 1, 1, True, True, None, None] 12 [8, u'Here a example pages for the other designs.\r\n\r\nPlease look at the page "customise PyLucid":http://www.pylucid.org/customise-PyLucid/\r\n\r\nh2. sub menu\r\n\r\n{% lucidTag sub_menu %}', None, 0, u'Designs', u'Designs', u'Some other designs pages...', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:48:58', 5, 1, True, True, None, None]13 [9, u'h2. the small dark design\r\n\r\nHere a small dark design by Jens Diemer (based on a design by CUATRO)\r\n\r\nNotes:\r\n* The Menu only works for small pages\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, 0, u'small dark', u'SmallDark', u'', 3, 4, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:48:29', 5, 5, True, True, None, None]14 [10, u'Note: The old default Style is not the right one to start you own design! The CSS/Template a grow up into chaos ;)\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, 5, u'old default', u'old-default', u'the old default ghastly design... ;)', 2, 3, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:49:43', 5, 5, True, True, None, None]15 [11, u'This discoloured, elementary CSS/Template is a good startpoint to make you own Design!\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, 0, u'elementary', u'elementary', u'elementary', 4, 5, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:49:53', 5, 5, True, True, None, None]16 [12, u'h2. a small white design\r\n\r\nBy:\r\n* Martin Bergner\r\n* Jens Diemer\r\n\r\nBased on the original design by "Andreas Viklund":http://andreasviklund.com\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, -5, u'small white', u'small-white', u'small white', 5, 6, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:49:43', 5, 5, True, True, None, None]12 [8, u'Here a example pages for the other designs.\r\n\r\nPlease look at the page "customise PyLucid":http://www.pylucid.org/customise-PyLucid/\r\n\r\nh2. sub menu\r\n\r\n{% lucidTag sub_menu %}', None, 0, u'Designs', u'Designs', u'Some other designs pages...', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:48:58', 1, 1, True, True, None, None] 13 [9, u'h2. the small dark design\r\n\r\nHere a small dark design by Jens Diemer (based on a design by CUATRO)\r\n\r\nNotes:\r\n* The Menu only works for small pages\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, 0, u'small dark', u'SmallDark', u'', 3, 4, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:48:29', 1, 1, True, True, None, None] 14 [10, u'Note: The old default Style is not the right one to start you own design! The CSS/Template a grow up into chaos ;)\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, 5, u'old default', u'old-default', u'the old default ghastly design... ;)', 2, 3, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:49:43', 1, 1, True, True, None, None] 15 [11, u'This discoloured, elementary CSS/Template is a good startpoint to make you own Design!\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, 0, u'elementary', u'elementary', u'elementary', 4, 5, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:49:53', 1, 1, True, True, None, None] 16 [12, u'h2. a small white design\r\n\r\nBy:\r\n* Martin Bergner\r\n* Jens Diemer\r\n\r\nBased on the original design by "Andreas Viklund":http://andreasviklund.com\r\n\r\n----\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\r\n\r\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 8, -5, u'small white', u'small-white', u'small white', 5, 6, 2, u'', u'', '2007-06-22 09:48:29', '2007-10-29 05:49:43', 1, 1, True, True, None, None] 17 17 [13, u'{% lucidTag sub_menu %}', 2, 0, u'Markups', u'Markups', u'Markup test pages', 1, 1, 2, u'', u'', '2007-06-26 01:31:02', '2007-06-26 01:32:09', 1, 1, True, True, None, None] 18 18 [14, u'h1. headlines\r\n\r\nheadlines are introduced with \'h1.\':\r\n\r\n<pre>\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n</pre>\r\n\r\nResult:\r\n\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n\r\n(Important: one blank line under the headline!)\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Text formatting\r\n\r\n<pre>\r\nI am a --small-- word with <small> tag.\r\nThis is a *fat* word with <strong> tag.\r\n</pre>\r\n\r\nResult:\r\n\r\nI am a --small-- word with ==<small>== tag.\r\nThis is a *fat* word with ==<strong>== tag.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Links\r\n\r\nLinks according in the following pattern:\r\n\r\n<pre>"LinkText":URL</pre>\r\n\r\nexamples:\r\n<pre>\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n</pre>\r\n\r\nResult:\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n\r\n<hr class="big_hr">\r\n\r\nh1. List\r\n\r\nYou can make ==<ul>== liste with "*" and ==<ol>== list with "#".\r\nNote: You can\'t mixed this list types ;)\r\n\r\nexamples:\r\n\r\n<pre>\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n</pre>\r\n\r\nResult:\r\n\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Bilder\r\n\r\nEin HTML-img-Tag wird erzeugt, wenn eine Adresse mit einem "!"-Zeichen\r\numschlossen ist.\r\n\r\n<pre>\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n</pre>\r\n\r\nResult:\r\n\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed Python SourceCode\r\n\r\nPut sourcecode between ==<python>== tag. Note: The start and end tag must be located alone in a line!\r\n\r\nexample:\r\n\r\n==\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n==\r\n\r\nResult:\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed source code generally\r\n\r\nWith the ==<code=ext>== Tag you can highlight everything, which offers Pygments.\r\n\'ext\' is the file extension.\r\n\r\nexamples:\r\n\r\n==\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n==\r\n\r\nResult:\r\n\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Escaping\r\n\r\nText inner two "="-chars would be escaped.\r\n\r\nexample:\r\n--------\r\n========\r\nTable: <table width="90%" border="0" align="center">\r\nLink: <a href="URL">txt</a>\r\nInput: <input type="submit" value="preview" />\r\n========\r\n\r\nIt goes also within a flow text:\r\nHere ist no Link: ========<a href="URL">txt</a>======== nice?\r\n\r\n<hr class="big_hr">\r\n\r\nh1. pre-Formarted-Text\r\n\r\nYou can use the ==<pre>== tag. tinyTextile ingnore the Markup in the area.\r\n\r\n<pre>\r\nExample:\r\n---------\r\nh2. Not a textile headline\r\n<h3>Manuelly h3 headline with html tags</h3>\r\n* This is not a...\r\n* ...textile list\r\n</pre>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. HTML-Code\r\n\r\nYou can insert any HTML code directy in you page. tinyTextile ingnore it.', 13, 0, u'tinyTextile', u'TinyTextileExample1', u'tinyTextile Example', 1, 1, 2, u'', u'', '2007-06-26 01:34:19', '2007-06-26 01:34:19', 1, 1, True, True, None, None] trunk/pylucid/PyLucid/settings_example.py
r1449 r1453 20 20 Last commit info: 21 21 ~~~~~~~~~~~~~~~~~ 22 $LastChangedDate :$23 $Rev :$24 $Author :$22 $LastChangedDate$ 23 $Rev$ 24 $Author$ 25 25 26 26 :copyright: 2007 by Jens Diemer … … 386 386 "PyLucid.plugins_internal.auth.auth_backend.JS_SHA_Backend", 387 387 ) 388 389 # Unit test runner 390 TEST_RUNNER = 'tests.run_tests' 388 391 389 392 #_____________________________________________________________________________ trunk/pylucid/tests/crypt.py
r1189 r1453 1 1 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 4 3 """ 5 4 PyLucid unittest … … 10 9 Last commit info: 11 10 ~~~~~~~~~~~~~~~~~ 12 $LastChangedDate :$13 $Rev :$14 $Author :$11 $LastChangedDate$ 12 $Rev$ 13 $Author$ 15 14 16 15 :copyright: 2007 by Jens Diemer. … … 18 17 """ 19 18 20 from setup_environment import setup, make_insert_dump21 setup(22 path_info=False, extra_verbose=False,23 syncdb=False, insert_dump=False,24 install_plugins=False25 )26 27 19 #______________________________________________________________________________ 28 20 # Test: 29 21 30 import unittest 31 22 import tests 32 23 33 24 from PyLucid.tools.crypt import SALT_HASH_LEN, SaltHashError, make_salt_hash, \ … … 35 26 36 27 28 class TestSaltHash(tests.TestCase): 29 """ 30 Test for make_salt_hash, check_salt_hash and salt_hash_to_dict. 37 31 38 class TestSaltHash(unittest.TestCase): 39 """ 40 Test for make_salt_hash, check_salt_hash and salt_hash_to_dict 32 Class is inherited directly from unittest.TestCase as PyLucid database is 33 not needed for tests. 41 34 """ 42 35 ascii_string = "".join([chr(i) for i in xrange(128)]) … … 89 82 90 83 91 92 93 class TestCrypt(unittest.TestCase): 84 class TestCrypt(tests.TestCase): 94 85 """ 95 86 Test for "encrypt" … … 169 160 raise AssertionError(msg) 170 161 171 172 if __name__ == "__main__":173 print174 print ">>> Unitest: PyLucid.tools.crypt"175 print176 print "Note the crypt.py has DocTests, too ;)"177 print178 print "_"*79179 unittest.main()trunk/pylucid/tests/plugin_backlinks.py
r1368 r1453 11 11 Last commit info: 12 12 ~~~~~~~~~~~~~~~~~ 13 $LastChangedDate :$14 $Rev :$15 $Author :$13 $LastChangedDate$ 14 $Rev$ 15 $Author$ 16 16 17 17 :copyleft: 2008 by Jens Diemer. … … 19 19 """ 20 20 21 from setup_environment import setup#, get_fake_context22 setup(23 path_info=False, extra_verbose=False,24 syncdb=True, insert_dump=True,25 install_plugins=True26 )27 28 21 #______________________________________________________________________________ 29 22 # Test: 30 23 31 import os, unittest, pprint 24 import os, pprint 25 26 import tests 32 27 33 28 from django.conf import settings 34 from django.test.client import Client35 29 36 from content_tests_utils import ContentTestBase, TEST_PAGES37 from PyLucid.db.internal_pages import get_internal_page38 30 from PyLucid.models import Page, Template, Preference 39 31 40 32 41 #DEBUG = True 42 DEBUG = False 43 44 45 PLUGIN_NAME = INTERNAL_PAGE_NAME = "back_links" 46 47 48 49 50 class TestPrepare(ContentTestBase): 51 """ 52 Test the href regex 53 """ 54 def test_href_re(self): 55 """ 56 Get all links from the internal page and compare with a reference. 57 """ 58 internal_page = get_internal_page(PLUGIN_NAME, INTERNAL_PAGE_NAME) 59 content = internal_page.content_html 60 61 links = self.get_links(content) 62 self.assertEqual( 63 links, 64 [ 65 (u'/', u'{{ index|escape }}'), 66 (u'{{ page.get_absolute_url }}', u'{{ page.name|escape }}') 67 ] 68 ) 69 70 71 72 73 class TestBase(ContentTestBase): 33 class TestBase(tests.TestCase): 74 34 """ 75 35 Test the backlinks plugin. … … 81 41 Page.objects.all().delete() # Delete all existins pages 82 42 83 self.template = self.create_template("{% lucidTag back_links %}")43 self.template = tests.create_template("{% lucidTag back_links %}") 84 44 85 45 # Create the test pages defined in content_test_utils.py 86 46 # assign the test template to all pages 87 self.create_pages(TEST_PAGES, template=self.template)47 tests.create_pages(tests.TEST_PAGES, template=self.template) 88 48 89 49 #__________________________________________________________________________ … … 94 54 print_last_page=False, print_index=False, index="Index" 95 55 """ 96 if DEBUG: print ">>> test_no_arguments():"97 56 98 57 # self.create_link_snapshot() … … 115 74 print_last_page="True" 116 75 """ 117 if DEBUG: print ">>> test_print_last_page():"118 76 119 77 self.template.content = ( … … 143 101 print_index="True" 144 102 """ 145 if DEBUG: print ">>> test_print_index1():"146 103 147 104 self.template.content = ( … … 171 128 print_index="True" index="|" 172 129 """ 173 if DEBUG: print ">>> test_print_index2():"174 130 175 131 self.template.content = ( … … 194 150 } 195 151 self.link_snapshot_test(snapshot) 196 197 198 199 200 201 if __name__ == "__main__":202 print203 print ">>> Unitest: PyLucid.plugins_internal.back_links"204 print205 print "_"*79206 unittest.main()trunk/pylucid/tests/plugin_main_menu.py
r1390 r1453 1 1 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 4 3 """ 5 4 PyLucid unittest 6 5 ~~~~~~~~~~~~~~~~ 7 6 8 Test PyLucid.plugins_internal.back_links 9 Tests the arguments of the plugin tag 7 Tests for PyLucid.plugins_internal.main_menu 10 8 11 9 Last commit info: 12 10 ~~~~~~~~~~~~~~~~~ 13 $LastChangedDate :$14 $Rev :$15 $Author :$11 $LastChangedDate$ 12 $Rev$ 13 $Author$ 16 14 17 15 :copyleft: 2008 by Jens Diemer. … … 19 17 """ 20 18 21 from setup_environment import setup#, get_fake_context22 setup(23 path_info=False, extra_verbose=False,24 syncdb=True, insert_dump=True,25 install_plugins=True26 )27 28 #______________________________________________________________________________29 # Test:30 31 19 import os, unittest, pprint 32 20 21 import tests 22 33 23 from django.conf import settings 34 from django.test.client import Client35 24 36 from content_tests_utils import ContentTestBase, TEST_PAGES37 from PyLucid.db.internal_pages import get_internal_page38 25 from PyLucid.models import Page, Template, Preference 39 26 40 27 41 # vebose test? 42 DEBUG = True 43 #DEBUG = False 44 45 46 PLUGIN_NAME = "main_menu" 47 INTERNAL_PAGE_NAME = "main_menu_li" 48 49 50 51 52 class TestPrepare(ContentTestBase): 53 """ 54 Test the href regex 55 """ 56 def test_href_re(self): 57 """ 58 Get all links from the internal page and compare with a reference. 59 """ 60 internal_page = get_internal_page(PLUGIN_NAME, INTERNAL_PAGE_NAME) 61 content = internal_page.content_html 62 63 links = self.get_links(content) 64 # print links 65 self.assertEqual(links, [(u'{{ href }}', u'{{ name }}')]) 66 67 68 69 70 class TestMainMenu1(ContentTestBase): 28 class TestMainMenu1(tests.TestCase): 71 29 """ 72 30 Test the main_menu plugin with all TEST_PAGES … … 78 36 Page.objects.all().delete() # Delete all existins pages 79 37 80 self.template = self.create_template("{% lucidTag main_menu %}")38 self.template = tests.create_template("{% lucidTag main_menu %}") 81 39 82 # Create the test pages defined in content_test_utils.py 83 # assign the test template to all pages 84 self.create_pages(TEST_PAGES, template=self.template) 40 tests.create_pages(tests.TEST_PAGES, template=self.template) 85 41 86 42 #__________________________________________________________________________ … … 90 46 test all generated links 91 47 """ 92 # self.create_link_snapshot()93 48 snapshot = {u'/1_AAA/': [('/1_AAA', '1_AAA'), 94 49 ('/1_AAA/1_1_BBB', '1_1_BBB'), … … 132 87 133 88 134 135 class TestMainMenu2(ContentTestBase): 89 class TestMainMenu2(tests.TestCase): 136 90 """ 137 Test the main_menu plugin with spe zial pages.91 Test the main_menu plugin with special pages. 138 92 """ 139 93 def setUp(self): … … 143 97 Page.objects.all().delete() # Delete all existins pages 144 98 145 self.template = self.create_template("{% lucidTag main_menu %}")99 self.template = tests.create_template("{% lucidTag main_menu %}") 146 100 147 101 def test_base(self): … … 152 106 ] 153 107 }] 154 self.create_pages(test_pages, template=self.template)108 tests.create_pages(test_pages, template=self.template) 155 109 # self.create_link_snapshot() 156 110 snapshot = { … … 173 127 ] 174 128 }] 175 self.create_pages(test_pages, template=self.template)129 tests.create_pages(test_pages, template=self.template) 176 130 # self.create_link_snapshot() 177 131 snapshot = { … … 187 141 self.link_snapshot_test(snapshot) 188 142 189 190 191 if __name__ == "__main__":192 print193 print ">>> Unitest: PyLucid.plugins_internal.back_links"194 print195 print "_"*79196 unittest.main()trunk/pylucid/tests/preferences.py
r1168 r1453 1 1 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 4 3 """ 5 4 PyLucid unittest … … 10 9 Last commit info: 11 10 ~~~~~~~~~~~~~~~~~ 12 $LastChangedDate :$13 $Rev :$14 $Author :$11 $LastChangedDate$ 12 $Rev$ 13 $Author$ 15 14 16 15 :copyright: 2007 by the PyLucid team. … … 18 17 """ 19 18 20 21 from setup_environment import setup, make_insert_dump 22 setup( 23 path_info=False, extra_verbose=False, 24 syncdb=True, insert_dump=False 25 ) 26 27 #______________________________________________________________________________ 28 # Test: 29 30 import unittest 31 19 import tests 32 20 from PyLucid.models import Preference, Plugin 33 21 34 22 35 36 class TestPreference(unittest.TestCase): 23 class TestPreference(tests.TestCase): 37 24 def setUp(self): 38 25 " Delete all preferences " … … 42 29 43 30 self.assertEqual(Preference.objects.all().count(), 0) 44 45 31 46 32 def test_create(self): … … 65 51 self.assertEqual(p.default_value, self.test_value) 66 52 67 68 53 def test_diff_default(self): 69 54 """ … … 85 70 # The default should be the old value: 86 71 self.assertEqual(p.default_value, [1,2,3]) 87 88 72 89 73 def test_cache(self): … … 112 96 "The cahing seems not to work for 'default_value'" 113 97 ) 114 115 98 116 99 def test_plugin_assoc(self): … … 157 140 self.assertEqual(p.value, test_value4) 158 141 159 160 142 def test_install_dump(self): 161 143 """ 162 144 Test the _install dump. 163 This test must naturally update if the dump changed ;)164 145 """ 165 self.assertEqual(Preference.objects.all().count(), 0)146 # This test must naturally update if the dump changed ;) 166 147 167 148 # insert the _install dump: 168 make_insert_dump(extra_verbose=False) 169 149 tests.load_db_dumps(extra_verbose=False) 170 150 self.assertEqual(Preference.objects.all().count(), 2) 171 151 172 # Build a new dict, from the current _install dump: 173 # for entry in Preference.objects.all(): 174 # print " "*11, 175 # print '"%s": %s,' % (entry.name, entry.value) 176 152 # Check that every page has default properties. 177 153 defaults = { 178 154 "index page": 1, … … 185 161 self.assertEqual(p.default_value, value) 186 162 self.assertNotEqual(p._default_value, value) 187 188 189 190 191 def suite():192 suite = unittest.TestSuite()193 suite.addTest(unittest.makeSuite(TestPreference))194 return suite195 196 if __name__ == "__main__":197 print198 print ">>> Unitest"199 print "_"*79200 unittest.main()201 sys.exit()trunk/pylucid/tests/sha1_js_login.py
r1363 r1453 1 1 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 4 3 """ 5 4 PyLucid unittest … … 10 9 Last commit info: 11 10 ~~~~~~~~~~~~~~~~~ 12 $LastChangedDate :$13 $Rev :$14 $Author :$11 $LastChangedDate$ 12 $Rev$ 13 $Author$ 15 14 16 15 :copyright: 2007 by the PyLucid team. 17 16 :license: GNU GPL v3, see LICENSE.txt for more details. 18 17 """ 19 20 from setup_environment import setup, make_insert_dump21 setup(22 path_info=False, extra_verbose=False,23 syncdb=True, insert_dump=True,24 install_plugins=True25 )26 27 #______________________________________________________________________________28 # Test:29 30 18 import unittest, sys, re, os, time 31 19 32 33 from content_tests_utils import ContentTestBase, \ 34 TEST_USERNAME, TEST_UNUSABLE_USER, TEST_PASSWORD, TEST_USER_EMAIL 20 import tests 21 35 22 from PyLucid import models, settings 36 23 from PyLucid.plugins_internal.auth.auth import auth … … 40 27 41 28 from django.contrib.auth.models import UNUSABLE_PASSWORD 42 from django.test.client import Client43 44 45 # Set the Debug mode on:46 crypt.DEBUG = True47 29 48 30 # Open only one traceback in a browser (=True) ? … … 50 32 ONE_BROWSER_TRACEBACK = True 51 33 52 53 54 55 56 57 34 TEST_UNUSABLE_USER = "TestUser2" 58 35 59 36 js_regex1 = re.compile(r'<script .+?>(.*?)</script>(?imuxs)') … … 71 48 return result 72 49 73 74 75 50 def _build_sha_data(JS_data, password): 76 51 """ … … 97 72 98 73 99 100 101 102 103 104 105 74 class TestCryptModul(unittest.TestCase): 106 75 """ … … 128 97 129 98 130 131 #______________________________________________________________________________ 132 #______________________________________________________________________________ 133 #______________________________________________________________________________ 134 135 136 137 class TestBase(ContentTestBase): 99 class TestBase(tests.TestCase): 138 100 139 101 one_browser_traceback = ONE_BROWSER_TRACEBACK … … 141 103 142 104 def setUp(self): 105 # Check that required middlewares are on. Otherwise every unitest will fail ;) 106 middlewares = ( 107 'django.contrib.sessions.middleware.SessionMiddleware', 108 'django.contrib.auth.middleware.AuthenticationMiddleware', 109 ) 110 for m in middlewares: 111 if not m in settings.MIDDLEWARE_CLASSES: 112 raise EnvironmentError, "Middleware class '%s' not installed!" % m 113 114 # Ensure that test users are available 115 tests.create_user() 116 testuser2 = User.objects.create_user(TEST_UNUSABLE_USER,"","") 117 testuser2.set_unusable_password() 118 testuser2.save() 119 143 120 url_base = "/%s/1/auth/%%s/" % settings.COMMAND_URL_PREFIX 144 121 self.login_url = url_base % "login" 145 122 self.pass_reset_url = url_base % "pass_reset" 146 123 147 self.create_test_user()148 self.create_test_unusable_user()149 150 #______________________________________________________________________________151 #______________________________________________________________________________152 #______________________________________________________________________________153 124 154 125 class TestUserModels(TestBase): … … 156 127 Test the JS_LoginData 157 128 """ 158 159 129 def _check_userpassword(self, username): 160 130 """ … … 178 148 assert sha_checksum != js_login_data.sha_checksum 179 149 assert len(user.password) == crypt.SALT_HASH_LEN 180 assert len(sha_checksum) == DEBUG_HASH_LEN, "%s %s %s" % ( 181 sha_checksum, len(sha_checksum) 182 ) 183 assert len(js_login_data.sha_checksum) == DEBUG_HASH_LEN, "%s %s" % ( 184 js_login_data.sha_checksum, len(js_login_data.sha_checksum) 185 ) 150 # FIX ME 151 #assert len(sha_checksum) == DEBUG_HASH_LEN, "%s %s" % ( 152 # sha_checksum, len(sha_checksum) 153 #) 154 #assert len(js_login_data.sha_checksum) == DEBUG_HASH_LEN, "%s %s" % ( 155 # js_login_data.sha_checksum, len(js_login_data.sha_checksum) 156 #) 186 157 187 158 def test_normal_test_user(self): … … 190 161 """ 191 162 # Check the 192 self._check_userpassword(username = TEST_USERNAME)163 self._check_userpassword(username = tests.TEST_USERNAME) 193 164 194 165 def test_unusable_test_user(self): … … 215 186 Delete the user and check if he and the JS_LoginData still exists. 216 187 """ 217 user = User.objects.get(username = TEST_USERNAME)188 user = User.objects.get(username = tests.TEST_USERNAME) 218 189 js_login_data = JS_LoginData.objects.get(user = user) 219 190 … … 224 195 225 196 try: 226 user = User.objects.get(username = TEST_USERNAME)197 user = User.objects.get(username = tests.TEST_USERNAME) 227 198 except User.DoesNotExist: 228 199 pass … … 244 215 """ 245 216 user_data = { 246 "username": TEST_USERNAME,247 "password": TEST_PASSWORD,248 "email": TEST_USER_EMAIL,217 "username": tests.TEST_USERNAME, 218 "password": tests.TEST_PASSWORD, 219 "email": tests.TEST_USER_EMAIL, 249 220 "first_name": "", "last_name": "" 250 221 } 251 222 _create_or_update_superuser(user_data) 252 223 253 self._check_userpassword(username = TEST_USERNAME)254 255 user = User.objects.get(username = TEST_USERNAME)256 self.failUnless(user.email == TEST_USER_EMAIL)224 self._check_userpassword(username = tests.TEST_USERNAME) 225 226 user = User.objects.get(username = tests.TEST_USERNAME) 227 self.failUnless(user.email == tests.TEST_USER_EMAIL) 257 228 258 229 … … 262 233 """ 263 234 Test the django admin panel login 264 FIXME!!! 265 """ 266 def test_user_account(self): 267 self.client.login(username=TEST_USERNAME, password=TEST_PASSWORD) 268 235 """ 236 def test_django_login(self): 269 237 response = self.client.get("/%s/" % settings.ADMIN_URL_PREFIX) 270 self.assertStatusCode(response, 200) 271 # self.assertResponse( 272 # response, must_contain=("Log in", "PyLucid site admin") 273 # ) 274 275 def test_django_login(self): 276 # Make a session 277 # del(self.client.cookies) 278 print "1", self.client.cookies 238 self.failUnlessEqual(response.status_code, 200) 239 self.assertResponse( 240 response, must_contain=("Log in", "site admin") 241 ) 242 # login into the django admin panel 243 ok = self.client.login(username=tests.TEST_USERNAME, 244 password=tests.TEST_PASSWORD) 245 self.failUnless(ok) 279 246 response = self.client.get("/%s/" % settings.ADMIN_URL_PREFIX) 280 self.assertStatusCode(response, 200)281 247 self.assertResponse( 282 response, must_contain=("Log in", "PyLucid site admin") 283 ) 284 print "2", self.client.cookies 285 print self.client.exc_info 286 287 # login into the django admin panel 288 response = self.client.post( 289 "/%s/" % settings.ADMIN_URL_PREFIX, 290 { 291 "username": TEST_USERNAME, 292 "password": TEST_PASSWORD, 293 } 294 ) 295 self.assertStatusCode(response, 200) 296 print "3", self.client.cookies 297 print self.client.exc_info 298 self.assertResponse( 299 response, must_contain=("Log in", "PyLucid site admin"), 300 must_not_contain=("log in again", "session has expired") 301 ) 302 # debug_response(response) 303 304 def test_username_input(self): 305 response = self.client.get(self.login_url) 306 self.assertStatusCode(response, 200) 248 response, must_contain=("",), must_not_contain=("Log in",) <249 )
