@pytest.mark.django_db
def test_update_plural_target_dict(af_tutorial_po):
 db_unit = _update_translation(af_tutorial_po, 2, {'target': {0: u'samaka', 1: u'samak'}})
 store_unit = af_tutorial_po.file.store.findid(db_unit.getid())
 assert (db_unit.target.strings == [u'samaka', u'samak'])
 assert (db_unit.target.strings == store_unit.target.strings)
 po_file = factory.getobject(af_tutorial_po.file.path)
 assert (db_unit.target.strings == po_file.findid(db_unit.getid()).target.strings)
 assert (db_unit.target == u'samaka')
 assert (db_unit.target == store_unit.target)
 assert (db_unit.target == po_file.findid(db_unit.getid()).target)

@ pytest . mark . django_db def test_update_plural_target_dict ( af_tutorial_po ) : db_unit = _update_translation ( af_tutorial_po , 2 , { 'target' : { 0 : u'samaka' , 1 : u'samak' } } ) store_unit = af_tutorial_po . file . store . findid ( db_unit . getid ( ) ) assert ( db_unit . target . strings == [ u'samaka' , u'samak' ] ) assert ( db_unit . target . strings == store_unit . target . strings ) po_file = factory . getobject ( af_tutorial_po . file . path ) assert ( db_unit . target . strings == po_file . findid ( db_unit . getid ( ) ) . target . strings ) assert ( db_unit . target == u'samaka' ) assert ( db_unit . target == store_unit . target ) assert ( db_unit . target == po_file . findid ( db_unit . getid ( ) ) . target )
tests plural translations are stored and synced .