<s> import mongoengine <EOL> from st2common . models . db import stormbase <EOL> from st2common . util import date as date_utils <EOL> from st2tests import DbTestCase <EOL> class FakeModel ( stormbase . StormBaseDB ) : <EOL> boolean_field = mongoengine . BooleanField ( ) <EOL> datetime_field = mongoengine . DateTimeField ( ) <EOL> dict_field = mongoengine . DictField ( ) <EOL> integer_field = mongoengine . IntField ( ) <EOL> list_field = mongoengine . ListField ( ) <EOL> class TestBaseModel ( DbTestCase ) : <EOL> def test_print ( self ) : <EOL> instance = FakeModel ( name = '<STR_LIT>' , boolean_field = True , <EOL> datetime_field = date_utils . get_datetime_utc_now ( ) , <EOL> description = u'<STR_LIT>' , dict_field = { '<STR_LIT:a>' : <NUM_LIT:1> } , <EOL> integer_field = <NUM_LIT> , list_field = [ '<STR_LIT:abc>' ] ) <EOL> expected = ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % str ( instance . datetime_field ) ) <EOL> self . assertEqual ( str ( instance ) , expected ) </s>
