<s> from django . test . client import RequestFactory <EOL> from onadata . apps . main . tests . test_base import TestBase <EOL> from onadata . libs . utils . viewer_tools import export_def_from_filename , get_client_ip <EOL> class TestViewerTools ( TestBase ) : <EOL> def test_export_def_from_filename ( self ) : <EOL> filename = "<STR_LIT>" <EOL> ext , mime_type = export_def_from_filename ( filename ) <EOL> self . assertEqual ( ext , '<STR_LIT>' ) <EOL> self . assertEqual ( mime_type , '<STR_LIT>' ) <EOL> def test_get_client_ip ( self ) : <EOL> request = RequestFactory ( ) . get ( "<STR_LIT:/>" ) <EOL> client_ip = get_client_ip ( request ) <EOL> self . assertIsNotNone ( client_ip ) <EOL> self . assertEqual ( client_ip , "<STR_LIT:127.0.0.1>" ) </s>
