<s> from django . test import TestCase <EOL> try : <EOL> from django . utils . encoding import smart_unicode <EOL> except ImportError : <EOL> from django . utils . encoding import smart_text as smart_unicode <EOL> from datetime import datetime <EOL> from pagseguro . models import Checkout , Transaction , TransactionHistory <EOL> class CheckoutTest ( TestCase ) : <EOL> def test_create_model ( self ) : <EOL> checkout = Checkout . objects . create ( <EOL> code = '<STR_LIT>' , <EOL> date = datetime . now ( ) , <EOL> success = True <EOL> ) <EOL> self . assertEqual ( <EOL> smart_unicode ( checkout ) , '<STR_LIT>' . format ( checkout . pk ) <EOL> ) <EOL> class TransactionTest ( TestCase ) : <EOL> def test_create_model ( self ) : <EOL> transaction = Transaction . objects . create ( <EOL> code = '<STR_LIT>' , <EOL> reference = '<STR_LIT>' , <EOL> status = '<STR_LIT>' , <EOL> date = datetime . now ( ) , <EOL> last_event_date = datetime . now ( ) <EOL> ) <EOL> self . assertEqual ( <EOL> smart_unicode ( transaction ) , transaction . code <EOL> ) <EOL> class TransactionHistoryTest ( TestCase ) : <EOL> def test_create_model ( self ) : <EOL> transaction = Transaction . objects . create ( <EOL> code = '<STR_LIT>' , <EOL> reference = '<STR_LIT>' , <EOL> status = '<STR_LIT>' , <EOL> date = datetime . now ( ) , <EOL> last_event_date = datetime . now ( ) <EOL> ) <EOL> tx_history = TransactionHistory . objects . create ( <EOL> transaction = transaction , <EOL> date = datetime . now ( ) , <EOL> status = '<STR_LIT>' <EOL> ) <EOL> self . assertEqual ( <EOL> smart_unicode ( tx_history ) , <EOL> '<STR_LIT>' . format ( <EOL> tx_history . transaction , tx_history . status , tx_history . date <EOL> ) <EOL> ) </s>
