<s> import shopify <EOL> from test . test_helper import TestCase <EOL> from pyactiveresource . activeresource import ActiveResource <EOL> from pyactiveresource . util import xml_to_dict <EOL> class OrderTest ( TestCase ) : <EOL> def test_should_be_loaded_correctly_from_order_xml ( self ) : <EOL> order_xml = """<STR_LIT>""" <EOL> order = shopify . Order ( xml_to_dict ( order_xml ) [ "<STR_LIT>" ] ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( order . note_attributes ) ) <EOL> note_attribute = order . note_attributes [ <NUM_LIT:0> ] <EOL> self . assertEqual ( "<STR_LIT:size>" , note_attribute . name ) <EOL> self . assertEqual ( "<STR_LIT>" , note_attribute . value ) <EOL> def test_should_be_able_to_add_note_attributes_to_an_order ( self ) : <EOL> order = shopify . Order ( ) <EOL> order . note_attributes = [ ] <EOL> order . note_attributes . append ( shopify . NoteAttribute ( { '<STR_LIT:name>' : "<STR_LIT>" , '<STR_LIT:value>' : "<STR_LIT>" } ) ) <EOL> order_xml = xml_to_dict ( order . to_xml ( ) ) <EOL> note_attributes = order_xml [ "<STR_LIT>" ] [ "<STR_LIT>" ] <EOL> self . assertTrue ( isinstance ( note_attributes , list ) ) <EOL> attribute = note_attributes [ <NUM_LIT:0> ] <EOL> self . assertEqual ( "<STR_LIT>" , attribute [ "<STR_LIT:name>" ] ) <EOL> self . assertEqual ( "<STR_LIT>" , attribute [ "<STR_LIT:value>" ] ) <EOL> def test_get_order ( self ) : <EOL> self . fake ( '<STR_LIT>' , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> order = shopify . Order . find ( <NUM_LIT> ) <EOL> self . assertEqual ( '<STR_LIT>' , order . email ) <EOL> def test_get_order_transaction ( self ) : <EOL> self . fake ( '<STR_LIT>' , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> order = shopify . Order . find ( <NUM_LIT> ) <EOL> self . fake ( '<STR_LIT>' , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> transactions = order . transactions ( ) <EOL> self . assertEqual ( "<STR_LIT>" , transactions [ <NUM_LIT:0> ] . amount ) </s>
