aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pygments_api/tests.py
diff options
context:
space:
mode:
authormarkotibold2011-04-27 14:29:59 +0200
committermarkotibold2011-04-27 14:29:59 +0200
commit391560e69c5e37edac2e3c470253e7dce3c62511 (patch)
treee1f03db8fe74f601fb03e5f9eaa48b7483add60a /examples/pygments_api/tests.py
parent31bfdbeb1a5911e4c313b6742dfb6cb70ee13a5c (diff)
downloaddjango-rest-framework-391560e69c5e37edac2e3c470253e7dce3c62511.tar.bz2
The test was bad. It expected 11 snippets while the view made sure (as designed) that there would not be more than 10 snippets stored on disk.
Diffstat (limited to 'examples/pygments_api/tests.py')
-rw-r--r--examples/pygments_api/tests.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/pygments_api/tests.py b/examples/pygments_api/tests.py
index b4b01e8d..3bdc2ec5 100644
--- a/examples/pygments_api/tests.py
+++ b/examples/pygments_api/tests.py
@@ -28,12 +28,14 @@ class TestPygmentsExample(TestCase):
def test_snippets_datetime_sorted(self):
'''Pygments examples should be datetime sorted'''
locations = []
- for snippet in 'abcdefghijk':
+ for snippet in 'abcdefghij': # String length must not exceed views.MAX_FILES, otherwise test fails
form_data = {'code': '%s' % snippet, 'style':'friendly', 'lexer':'python'}
request = self.factory.post('/pygments', data=form_data)
view = views.PygmentsRoot.as_view()
response = view(request)
locations.append(response.items()[2][1])
+ import time
+ time.sleep(.1)
request = self.factory.get('/pygments')
view = views.PygmentsRoot.as_view()
response = view(request)