1
0
Fork 0
forked from github/pelican

Add index and author replacement indicators

This commit is contained in:
Onur Aslan 2015-09-15 02:24:21 +03:00
commit a6c258eb7f
5 changed files with 51 additions and 6 deletions

View file

@ -2,7 +2,7 @@
from __future__ import unicode_literals
from pelican.tests.support import unittest
from pelican.urlwrappers import Category, Tag, URLWrapper
from pelican.urlwrappers import Author, Category, Tag, URLWrapper
class TestURLWrapper(unittest.TestCase):
@ -34,9 +34,11 @@ class TestURLWrapper(unittest.TestCase):
def test_equality(self):
tag = Tag('test', settings={})
cat = Category('test', settings={})
author = Author('test', settings={})
# same name, but different class
self.assertNotEqual(tag, cat)
self.assertNotEqual(tag, author)
# should be equal vs text representing the same name
self.assertEqual(tag, u'test')
@ -48,5 +50,9 @@ class TestURLWrapper(unittest.TestCase):
tag_equal = Tag('Test', settings={})
self.assertEqual(tag, tag_equal)
# Author describing the same should be equal
author_equal = Author('Test', settings={})
self.assertEqual(author, author_equal)
cat_ascii = Category('指導書', settings={})
self.assertEqual(cat_ascii, u'zhi-dao-shu')