<s> """<STR_LIT>""" <EOL> from tests import case <EOL> class ProductAdminTest ( case . admin . AdminTestCase ) : <EOL> app_label = "<STR_LIT>" <EOL> model_name = "<STR_LIT>" <EOL> def test_changelist ( self ) : <EOL> """<STR_LIT>""" <EOL> self . F . ProductFactory . create ( name = "<STR_LIT>" ) <EOL> self . get ( self . changelist_url ) . mustcontain ( "<STR_LIT>" ) <EOL> def test_change_page ( self ) : <EOL> """<STR_LIT>""" <EOL> p = self . F . ProductFactory . create ( name = "<STR_LIT>" ) <EOL> self . get ( self . change_url ( p ) ) . mustcontain ( "<STR_LIT>" ) <EOL> def test_change_tracks_user ( self ) : <EOL> """<STR_LIT>""" <EOL> p = self . F . ProductFactory . create ( name = "<STR_LIT>" ) <EOL> url = self . change_url ( p ) <EOL> form = self . get ( url ) . forms [ <NUM_LIT:0> ] <EOL> form [ "<STR_LIT:name>" ] = "<STR_LIT>" <EOL> res = form . submit ( ) <EOL> self . assertEqual ( res . status_int , <NUM_LIT> ) <EOL> self . assertEqual ( self . refresh ( p ) . modified_by , self . user ) <EOL> def test_delete_tracks_user ( self ) : <EOL> """<STR_LIT>""" <EOL> p = self . F . ProductFactory . create ( name = "<STR_LIT>" ) <EOL> url = self . delete_url ( p ) <EOL> form = self . get ( url ) . forms [ <NUM_LIT:0> ] <EOL> res = form . submit ( ) <EOL> self . assertEqual ( res . status_int , <NUM_LIT> ) <EOL> self . assertEqual ( self . refresh ( p ) . deleted_by , self . user ) <EOL> def test_bulk_delete_tracks_user ( self ) : <EOL> """<STR_LIT>""" <EOL> p = self . F . ProductFactory . create ( name = "<STR_LIT>" ) <EOL> form = self . get ( self . changelist_url ) . forms [ "<STR_LIT>" ] <EOL> form [ "<STR_LIT:action>" ] = "<STR_LIT>" <EOL> form [ "<STR_LIT>" ] = str ( p . id ) <EOL> form . submit ( "<STR_LIT:index>" , <NUM_LIT:0> ) <EOL> self . assertEqual ( self . refresh ( p ) . deleted_by , self . user ) <EOL> def test_bulk_undelete ( self ) : <EOL> """<STR_LIT>""" <EOL> p = self . F . ProductFactory . create ( name = "<STR_LIT>" ) <EOL> p . delete ( ) <EOL> form = self . get ( self . changelist_url ) . forms [ "<STR_LIT>" ] <EOL> form [ "<STR_LIT:action>" ] = "<STR_LIT>" <EOL> form [ "<STR_LIT>" ] = str ( p . id ) <EOL> form . submit ( "<STR_LIT:index>" , <NUM_LIT:0> ) <EOL> self . assertEqual ( self . refresh ( p ) . deleted_on , None ) <EOL> def test_hard_delete ( self ) : <EOL> """<STR_LIT>""" <EOL> p = self . F . ProductFactory . create ( name = "<STR_LIT>" ) <EOL> form = self . get ( self . changelist_url ) . forms [ "<STR_LIT>" ] <EOL> form [ "<STR_LIT:action>" ] = "<STR_LIT>" <EOL> form [ "<STR_LIT>" ] = str ( p . id ) <EOL> form . submit ( "<STR_LIT:index>" , <NUM_LIT:0> ) . forms [ <NUM_LIT:0> ] . submit ( ) <EOL> self . assertEqual ( p . __class__ . objects . count ( ) , <NUM_LIT:0> ) </s>
