<s> from changes . models import Change <EOL> from changes . testutils import APITestCase <EOL> class ChangeListTest ( APITestCase ) : <EOL> def test_simple ( self ) : <EOL> project = self . create_project ( ) <EOL> project2 = self . create_project ( ) <EOL> change = self . create_change ( project ) <EOL> change2 = self . create_change ( project2 ) <EOL> resp = self . client . get ( '<STR_LIT>' ) <EOL> assert resp . status_code == <NUM_LIT:200> <EOL> data = self . unserialize ( resp ) <EOL> assert len ( data ) == <NUM_LIT:2> <EOL> assert data [ <NUM_LIT:0> ] [ '<STR_LIT:id>' ] == change2 . id . hex <EOL> assert data [ <NUM_LIT:1> ] [ '<STR_LIT:id>' ] == change . id . hex <EOL> class ChangeCreateTest ( APITestCase ) : <EOL> def test_simple ( self ) : <EOL> project = self . create_project ( ) <EOL> change = self . create_change ( project ) <EOL> path = '<STR_LIT>' . format ( change . id . hex ) <EOL> resp = self . client . post ( path , data = { <EOL> '<STR_LIT>' : project . slug , <EOL> '<STR_LIT:label>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } ) <EOL> assert resp . status_code == <NUM_LIT:200> <EOL> data = self . unserialize ( resp ) <EOL> assert data [ '<STR_LIT:id>' ] <EOL> change = Change . query . get ( data [ '<STR_LIT:id>' ] ) <EOL> assert change . project == project <EOL> assert change . label == '<STR_LIT>' <EOL> assert change . author . name == '<STR_LIT>' <EOL> assert change . author . email == '<STR_LIT>' </s>
