<s> from django . core . urlresolvers import reverse <EOL> from django . test import TestCase , override_settings <EOL> from rest_framework_docs . settings import DRFSettings <EOL> class DRFDocsViewTests ( TestCase ) : <EOL> SETTINGS_HIDE_DOCS = { <EOL> '<STR_LIT>' : True <EOL> } <EOL> def setUp ( self ) : <EOL> super ( DRFDocsViewTests , self ) . setUp ( ) <EOL> def test_settings_module ( self ) : <EOL> settings = DRFSettings ( ) <EOL> self . assertEqual ( settings . get_setting ( "<STR_LIT>" ) , False ) <EOL> self . assertEqual ( settings . get_setting ( "<STR_LIT>" ) , None ) <EOL> def test_index_view_with_endpoints ( self ) : <EOL> """<STR_LIT>""" <EOL> response = self . client . get ( reverse ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( response . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( response . context [ "<STR_LIT>" ] ) , <NUM_LIT:10> ) <EOL> self . assertEqual ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . name_parent , "<STR_LIT>" ) <EOL> self . assertEqual ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . allowed_methods , [ '<STR_LIT:POST>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . path , "<STR_LIT>" ) <EOL> self . assertEqual ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . docstring , "<STR_LIT>" ) <EOL> self . assertEqual ( len ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . fields ) , <NUM_LIT:2> ) <EOL> self . assertEqual ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . fields [ <NUM_LIT:0> ] [ "<STR_LIT:type>" ] , "<STR_LIT>" ) <EOL> self . assertTrue ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . fields [ <NUM_LIT:0> ] [ "<STR_LIT>" ] ) <EOL> self . assertEqual ( str ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:8> ] . errors ) , "<STR_LIT>" ) <EOL> def test_index_search_with_endpoints ( self ) : <EOL> response = self . client . get ( "<STR_LIT>" % reverse ( "<STR_LIT>" ) ) <EOL> self . assertEqual ( response . status_code , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( response . context [ "<STR_LIT>" ] ) , <NUM_LIT:2> ) <EOL> self . assertEqual ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:1> ] . path , "<STR_LIT>" ) <EOL> self . assertEqual ( len ( response . context [ "<STR_LIT>" ] [ <NUM_LIT:1> ] . fields ) , <NUM_LIT:3> ) <EOL> @ override_settings ( REST_FRAMEWORK_DOCS = SETTINGS_HIDE_DOCS ) <EOL> def test_index_view_docs_hidden ( self ) : <EOL> """<STR_LIT>""" <EOL> response = self . client . get ( reverse ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( response . status_code , <NUM_LIT> ) <EOL> self . assertEqual ( response . reason_phrase . upper ( ) , "<STR_LIT>" ) </s>
