<s> from os import path <EOL> from django . test import TestCase <EOL> from regressiontests . views . urls import media_dir <EOL> class StaticTests ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_serve ( self ) : <EOL> "<STR_LIT>" <EOL> media_files = [ '<STR_LIT>' , ] <EOL> for filename in media_files : <EOL> response = self . client . get ( '<STR_LIT>' % filename ) <EOL> file = open ( path . join ( media_dir , filename ) ) <EOL> self . assertEquals ( file . read ( ) , response . content ) <EOL> self . assertEquals ( len ( response . content ) , int ( response [ '<STR_LIT>' ] ) ) <EOL> def test_unknown_mime_type ( self ) : <EOL> response = self . client . get ( '<STR_LIT>' ) <EOL> self . assertEquals ( '<STR_LIT>' , response [ '<STR_LIT:Content-Type>' ] ) <EOL> def test_copes_with_empty_path_component ( self ) : <EOL> file_name = '<STR_LIT>' <EOL> response = self . client . get ( '<STR_LIT>' % file_name ) <EOL> file = open ( path . join ( media_dir , file_name ) ) <EOL> self . assertEquals ( file . read ( ) , response . content ) </s>
