Mercurial > wikked
annotate tests/test_db.py @ 451:6cd51ea6dfcf
auth: Rewrite permission system and improve support for it.
- More proper ACL model for permissions.
- Page-level ACL is only specified locally, not inherited anymore.
- Protect more API and UI routes with permission checks.
- Improve error handling and error pages.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 07 Jan 2018 11:11:04 -0800 |
parents | ebb12ff21cb2 |
children |
rev | line source |
---|---|
49 | 1 from tests import WikkedTest |
2 | |
3 | |
4 class DatabaseTest(WikkedTest): | |
5 def testEmpty(self): | |
225
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
6 wiki = self._getWikiFromStructure({}) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
7 self.assertEqual([], list(wiki.getPageUrls())) |
49 | 8 |
9 def testOnePage(self): | |
225
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
10 wiki = self._getWikiFromStructure({ |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
11 '/foo.txt': 'A test page.' |
49 | 12 }) |
225
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
13 self.assertEqual(['/foo'], list(wiki.getPageUrls())) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
14 page = wiki.getPage('/foo') |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
15 self.assertEqual('/foo', page.url) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
16 self.assertEqual('/foo.txt', page.path) |
49 | 17 self.assertEqual('A test page.', page.raw_text) |