Skip to content

Commit

Permalink
Tests should reflect forced lowercase paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming committed May 17, 2014
1 parent b032b61 commit bb82b46
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions wiki/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ def test_cleared_cache(self):
# revealed only by sequence of tests in some particular order
c = self.c
response = c.post(reverse('wiki:create', kwargs={'path': ''}),
{'title': 'Test cache', 'slug': 'TestCache', 'content': 'Content 1'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'TestCache/'}))
response = c.post(reverse('wiki:delete', kwargs={'path': 'TestCache/'}),
{'title': 'Test cache', 'slug': 'testcache', 'content': 'Content 1'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'testcache/'}))
response = c.post(reverse('wiki:delete', kwargs={'path': 'testcache/'}),
{'confirm': 'on', 'purge': 'on', 'revision': '2'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': ''}))
response = c.post(reverse('wiki:create', kwargs={'path': ''}),
{'title': 'Test cache', 'slug': 'TestCache', 'content': 'Content 2'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'TestCache/'}))
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'testcache/'}))
# test the cache
self.assertContains(self.get_by_path('TestCache/'), 'Content 2')

Expand All @@ -121,9 +121,9 @@ def test_article_list_update(self):
# verify the new article is added to article_list
response = c.post(reverse('wiki:create', kwargs={'path': ''}),
{'title': 'Sub Article 1', 'slug': 'SubArticle1'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'SubArticle1/'}))
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'subarticle1/'}))
self.assertContains(self.get_by_path(''), 'Sub Article 1')
self.assertContains(self.get_by_path(''), 'SubArticle1/')
self.assertContains(self.get_by_path(''), 'subarticle1/')
# verify the deleted article is removed from article_list
response = c.post(reverse('wiki:delete', kwargs={'path': 'SubArticle1/'}),
{'confirm': 'on', 'purge': 'on', 'revision': '3'})
Expand All @@ -145,12 +145,12 @@ def test_nested_create(self):
c = self.c
response = c.post(reverse('wiki:create', kwargs={'path': ''}),
{'title': 'Level 1', 'slug': 'Level1', 'content': 'Content level 1'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'Level1/'}))
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'level1/'}))
response = c.post(reverse('wiki:create', kwargs={'path': 'Level1/'}),
{'title': 'test', 'slug': 'Test', 'content': 'Content on level 2'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'Level1/Test/'}))
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'level1/test/'}))
response = c.post(reverse('wiki:create', kwargs={'path': ''}),
{'title': 'test', 'slug': 'Test', 'content': 'Other content on level 1'})
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'Test/'}))
self.assertRedirects(response, reverse('wiki:get', kwargs={'path': 'test/'}))
self.assertContains(self.get_by_path('Test/'), 'Other content on level 1')
self.assertContains(self.get_by_path('Level1/Test/'), 'Content') # on level 2')

0 comments on commit bb82b46

Please sign in to comment.