@pytest.mark.django_db
def test_accept_suggestion_update_wordcount(it_tutorial_po, system):
 it_tutorial_po.update(it_tutorial_po.file.store)
 suggestions = review.get(Suggestion)()
 untranslated_unit = it_tutorial_po.units[0]
 suggestion_text = 'foo bar baz'
 (sugg, added) = suggestions.add(untranslated_unit, suggestion_text)
 assert (sugg is not None)
 assert added
 assert (len(untranslated_unit.get_suggestions()) == 1)
 assert (untranslated_unit.state == UNTRANSLATED)
 review.get(Suggestion)([sugg], system).accept()
 assert (untranslated_unit.state == TRANSLATED)

@ pytest . mark . django_db def test_accept_suggestion_update_wordcount ( it_tutorial_po , system ) : it_tutorial_po . update ( it_tutorial_po . file . store ) suggestions = review . get ( Suggestion ) ( ) untranslated_unit = it_tutorial_po . units [ 0 ] suggestion_text = 'foo bar baz' ( sugg , added ) = suggestions . add ( untranslated_unit , suggestion_text ) assert ( sugg is not None ) assert added assert ( len ( untranslated_unit . get_suggestions ( ) ) == 1 ) assert ( untranslated_unit . state == UNTRANSLATED ) review . get ( Suggestion ) ( [ sugg ] , system ) . accept ( ) assert ( untranslated_unit . state == TRANSLATED )
tests that accepting a suggestion for an untranslated unit will change the wordcount stats of the units store .