-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #72: template settings for collections is now effective.
- Loading branch information
Showing
4 changed files
with
56 additions
and
15 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
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,26 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import LogyaBaseTestCase | ||
from logya.core import get_collection_var | ||
|
||
|
||
class TestIndex(LogyaBaseTestCase): | ||
|
||
def test_get_collection_var(self): | ||
collection_paths = { | ||
v['path']: k for k, v in self.config['collections'].items()} | ||
|
||
testdata = [ | ||
{'input': 'post', 'expected': None}, | ||
{'input': 'tags', 'expected': None}, | ||
{'input': 'tags/tag1', 'expected': 'tags'}, | ||
{'input': 'tags/tag-all', 'expected': 'tags'}, | ||
{'input': 'tags/tag2', 'expected': 'tags'}, | ||
{'input': 'shop/tags/tag1', 'expected': 'shoptags'}, | ||
{'input': 'shop/tags/tag-all', 'expected': 'shoptags'}, | ||
{'input': 'shop/tags/tag2', 'expected': 'shoptags'} | ||
] | ||
|
||
for data in testdata: | ||
self.assertEquals( | ||
data['expected'], | ||
get_collection_var(data['input'], collection_paths)) |