<s> from conftest import flaky_filter <EOL> from flaky import flaky <EOL> import pytest <EOL> @ flaky ( rerun_filter = flaky_filter ) <EOL> @ pytest . mark . usefixtures ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class TestCrudActions ( object ) : <EOL> def test_list ( self , app , model ) : <EOL> for i in range ( <NUM_LIT:1> , <NUM_LIT:12> ) : <EOL> model . create ( { '<STR_LIT:title>' : u'<STR_LIT>' . format ( i ) } ) <EOL> with app . test_client ( ) as c : <EOL> rv = c . get ( '<STR_LIT>' ) <EOL> assert rv . status == '<STR_LIT>' <EOL> body = rv . data . decode ( '<STR_LIT:utf-8>' ) <EOL> assert '<STR_LIT>' in body , "<STR_LIT>" <EOL> assert '<STR_LIT>' not in body , "<STR_LIT>" <EOL> assert '<STR_LIT>' in body , "<STR_LIT>" <EOL> def test_add ( self , app ) : <EOL> data = { <EOL> '<STR_LIT:title>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' <EOL> } <EOL> with app . test_client ( ) as c : <EOL> rv = c . post ( '<STR_LIT>' , data = data , follow_redirects = True ) <EOL> assert rv . status == '<STR_LIT>' <EOL> body = rv . data . decode ( '<STR_LIT:utf-8>' ) <EOL> assert '<STR_LIT>' in body <EOL> assert '<STR_LIT>' in body <EOL> assert '<STR_LIT>' in body <EOL> assert '<STR_LIT>' in body <EOL> def test_edit ( self , app , model ) : <EOL> existing = model . create ( { '<STR_LIT:title>' : "<STR_LIT>" } ) <EOL> with app . test_client ( ) as c : <EOL> rv = c . post ( <EOL> '<STR_LIT>' % existing [ '<STR_LIT:id>' ] , <EOL> data = { '<STR_LIT:title>' : '<STR_LIT>' } , <EOL> follow_redirects = True ) <EOL> assert rv . status == '<STR_LIT>' <EOL> body = rv . data . decode ( '<STR_LIT:utf-8>' ) <EOL> assert '<STR_LIT>' in body <EOL> assert '<STR_LIT>' not in body <EOL> def test_delete ( self , app , model ) : <EOL> existing = model . create ( { '<STR_LIT:title>' : "<STR_LIT>" } ) <EOL> with app . test_client ( ) as c : <EOL> rv = c . get ( <EOL> '<STR_LIT>' % existing [ '<STR_LIT:id>' ] , <EOL> follow_redirects = True ) <EOL> assert rv . status == '<STR_LIT>' <EOL> assert not model . read ( existing [ '<STR_LIT:id>' ] ) </s>
