mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
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.
This commit is contained in:
parent
31bfdbeb1a
commit
391560e69c
|
@ -28,12 +28,14 @@ class TestPygmentsExample(TestCase):
|
||||||
def test_snippets_datetime_sorted(self):
|
def test_snippets_datetime_sorted(self):
|
||||||
'''Pygments examples should be datetime sorted'''
|
'''Pygments examples should be datetime sorted'''
|
||||||
locations = []
|
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'}
|
form_data = {'code': '%s' % snippet, 'style':'friendly', 'lexer':'python'}
|
||||||
request = self.factory.post('/pygments', data=form_data)
|
request = self.factory.post('/pygments', data=form_data)
|
||||||
view = views.PygmentsRoot.as_view()
|
view = views.PygmentsRoot.as_view()
|
||||||
response = view(request)
|
response = view(request)
|
||||||
locations.append(response.items()[2][1])
|
locations.append(response.items()[2][1])
|
||||||
|
import time
|
||||||
|
time.sleep(.1)
|
||||||
request = self.factory.get('/pygments')
|
request = self.factory.get('/pygments')
|
||||||
view = views.PygmentsRoot.as_view()
|
view = views.PygmentsRoot.as_view()
|
||||||
response = view(request)
|
response = view(request)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user