@pytest.mark.django_db
def test_update_fuzzy(project0_nongnu, store0):
 db_unit = _update_translation(store0, 0, {'target': u'samaka', 'fuzzy': True})
 store_unit = store0.file.store.findid(db_unit.getid())
 assert db_unit.isfuzzy()
 assert (db_unit.isfuzzy() == store_unit.isfuzzy())
 po_file = factory.getobject(store0.file.path)
 assert (db_unit.isfuzzy() == po_file.findid(db_unit.getid()).isfuzzy())
 db_unit = _update_translation(store0, 0, {'fuzzy': False})
 store_unit = store0.file.store.findid(db_unit.getid())
 assert (not db_unit.isfuzzy())
 assert (db_unit.isfuzzy() == store_unit.isfuzzy())
 po_file = factory.getobject(store0.file.path)
 assert (db_unit.isfuzzy() == po_file.findid(db_unit.getid()).isfuzzy())

@ pytest . mark . django_db def test_update_fuzzy ( project0_nongnu , store0 ) : db_unit = _update_translation ( store0 , 0 , { 'target' : u'samaka' , 'fuzzy' : True } ) store_unit = store0 . file . store . findid ( db_unit . getid ( ) ) assert db_unit . isfuzzy ( ) assert ( db_unit . isfuzzy ( ) == store_unit . isfuzzy ( ) ) po_file = factory . getobject ( store0 . file . path ) assert ( db_unit . isfuzzy ( ) == po_file . findid ( db_unit . getid ( ) ) . isfuzzy ( ) ) db_unit = _update_translation ( store0 , 0 , { 'fuzzy' : False } ) store_unit = store0 . file . store . findid ( db_unit . getid ( ) ) assert ( not db_unit . isfuzzy ( ) ) assert ( db_unit . isfuzzy ( ) == store_unit . isfuzzy ( ) ) po_file = factory . getobject ( store0 . file . path ) assert ( db_unit . isfuzzy ( ) == po_file . findid ( db_unit . getid ( ) ) . isfuzzy ( ) )
tests fuzzy state changes are stored and synced .