#NEWLINE# def test_create_db( self ) : #NEWLINE# #INDENT# 'Create new entity in the database.' #NEWLINE# self . main_db_entity . delete ( ) #NEWLINE# self . main_vcs_entity . key = 'string-key' #NEWLINE# self . main_vcs_entity . comments = [ 'first comment' , 'second' ] #NEWLINE# self . main_vcs_entity . order = 7 #NEWLINE# self . main_vcs_translation . fuzzy = False #NEWLINE# self . main_vcs_entity . string_plural = 'plural string' #NEWLINE# self . main_vcs_entity . source = [ 'foo.py:87' ] #NEWLINE# self . changeset . create_db_entity ( self . main_vcs_entity ) #NEWLINE# self . changeset . execute ( ) #NEWLINE# new_entity = Entity . objects . get ( resource__path = self . main_vcs_resource . path , string = self . main_vcs_entity . string ) #NEWLINE# assert_attributes_equal ( new_entity , resource = self . main_db_resource , string = 'Source String' , key = 'string-key' , comment = 'first comment\nsecond' , order = 7 , string_plural = 'plural string' , source = [ 'foo.py:87' ] ) #NEWLINE# new_translation = new_entity . translation_set . all ( ) [ 0 ] #NEWLINE# assert_attributes_equal ( new_translation , locale = self . translated_locale , string = 'Translated String' , plural_form = None , approved = True , approved_date = aware_datetime ( 1970 , 1 , 1 ) , fuzzy = False )