<s> import json <EOL> from django . test . utils import override_settings <EOL> from testcases import TestCaseWithFixture <EOL> @ override_settings ( ROOT_URLCONF = '<STR_LIT>' , DEBUG = True ) <EOL> class ViewsWithoutSlashesTestCase ( TestCaseWithFixture ) : <EOL> def test_gets_without_trailing_slash ( self ) : <EOL> resp = self . client . get ( '<STR_LIT>' , data = { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertEqual ( resp . status_code , <NUM_LIT:200> ) <EOL> deserialized = json . loads ( resp . content . decode ( '<STR_LIT:utf-8>' ) ) <EOL> self . assertEqual ( len ( deserialized ) , <NUM_LIT:2> ) <EOL> self . assertEqual ( deserialized [ '<STR_LIT>' ] , { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } ) <EOL> resp = self . client . get ( '<STR_LIT>' , data = { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertEqual ( resp . status_code , <NUM_LIT:200> ) <EOL> deserialized = json . loads ( resp . content . decode ( '<STR_LIT:utf-8>' ) ) <EOL> self . assertEqual ( len ( deserialized ) , <NUM_LIT:2> ) <EOL> self . assertEqual ( deserialized [ '<STR_LIT>' ] [ '<STR_LIT>' ] , <NUM_LIT:20> ) <EOL> self . assertEqual ( len ( deserialized [ '<STR_LIT>' ] ) , <NUM_LIT:2> ) <EOL> self . assertEqual ( [ obj [ '<STR_LIT:title>' ] for obj in deserialized [ '<STR_LIT>' ] ] , [ u'<STR_LIT>' , u'<STR_LIT>' ] ) <EOL> resp = self . client . get ( '<STR_LIT>' , data = { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertEqual ( resp . status_code , <NUM_LIT:200> ) <EOL> deserialized = json . loads ( resp . content . decode ( '<STR_LIT:utf-8>' ) ) <EOL> self . assertEqual ( len ( deserialized ) , <NUM_LIT:9> ) <EOL> self . assertEqual ( deserialized [ '<STR_LIT:title>' ] , u'<STR_LIT>' ) <EOL> resp = self . client . get ( '<STR_LIT>' , data = { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertEqual ( resp . status_code , <NUM_LIT:200> ) <EOL> deserialized = json . loads ( resp . content . decode ( '<STR_LIT:utf-8>' ) ) <EOL> obj_ids = [ o [ "<STR_LIT:id>" ] for o in deserialized [ "<STR_LIT>" ] ] <EOL> self . assertEqual ( sorted ( obj_ids ) , [ <NUM_LIT:1> , <NUM_LIT:2> ] ) </s>
