@pytest.mark.django_db
def test_accept_suggestion_changes_state(issue_2401_po, system):
 suggestions = review.get(Suggestion)()
 unit = issue_2401_po.units[0]
 assert (unit.state == UNTRANSLATED)
 (suggestion, created_) = suggestions.add(unit, 'foo')
 assert (unit.state == UNTRANSLATED)
 review.get(Suggestion)([suggestion], system).accept()
 assert (unit.state == TRANSLATED)
 unit = issue_2401_po.units[1]
 assert (unit.state == TRANSLATED)
 (suggestion, created_) = suggestions.add(unit, 'bar')
 assert (unit.state == TRANSLATED)
 review.get(Suggestion)([suggestion], system).accept()
 assert (unit.state == TRANSLATED)
 unit = issue_2401_po.units[2]
 assert (unit.state == FUZZY)
 (suggestion, created_) = suggestions.add(unit, 'baz')
 assert (unit.state == FUZZY)
 review.get(Suggestion)([suggestion], system).accept()
 assert (unit.state == TRANSLATED)

@ pytest . mark . django_db def test_accept_suggestion_changes_state ( issue_2401_po , system ) : suggestions = review . get ( Suggestion ) ( ) unit = issue_2401_po . units [ 0 ] assert ( unit . state == UNTRANSLATED ) ( suggestion , created_ ) = suggestions . add ( unit , 'foo' ) assert ( unit . state == UNTRANSLATED ) review . get ( Suggestion ) ( [ suggestion ] , system ) . accept ( ) assert ( unit . state == TRANSLATED ) unit = issue_2401_po . units [ 1 ] assert ( unit . state == TRANSLATED ) ( suggestion , created_ ) = suggestions . add ( unit , 'bar' ) assert ( unit . state == TRANSLATED ) review . get ( Suggestion ) ( [ suggestion ] , system ) . accept ( ) assert ( unit . state == TRANSLATED ) unit = issue_2401_po . units [ 2 ] assert ( unit . state == FUZZY ) ( suggestion , created_ ) = suggestions . add ( unit , 'baz' ) assert ( unit . state == FUZZY ) review . get ( Suggestion ) ( [ suggestion ] , system ) . accept ( ) assert ( unit . state == TRANSLATED )
tests that accepting a suggestion will change the state of the unit .