Mercurial > wikked
annotate tests/test_db.py @ 473:93d84f2c2b31
web: Prevent editing pages in a read-only endpoint.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 08 Oct 2018 23:47:02 -0700 |
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) |