Skip to content

Commit

Permalink
Started adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiro committed Aug 13, 2013
1 parent b07607d commit 0cc4946
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/servers/tests.py
Expand Up @@ -138,13 +138,15 @@ def test_static_files(self):
f = self.urlopen('/static/example_static_file.txt')
self.assertEqual(f.read().rstrip(b'\r\n'), b'example static file')

def test_collectstatic_emulation(self):
"""
Test LiveServerTestCase use of staticfiles' serve() allows it to
discover app's static assets without having to collectstatic first.
"""
f = self.urlopen('/static/another_app/another_app_static_file.txt')
self.assertEqual(f.read().rstrip(b'\r\n'), b'static file from another_app')
def test_collects_static_files(self):
try:
self.urlopen('/static/another_app/another_app_static_file.txt')
except HTTPError as err:
print(err)
#self.assertEqual(f.read().rstrip(b'\r\n'), b'static file from another_app')
self.assertEqual(err.code, 404, 'Expected 404 response')
else:
self.fail('Expected 404 response')

def test_media_files(self):
"""
Expand Down

0 comments on commit 0cc4946

Please sign in to comment.