@pytest.mark.django_db
def test_hash(store0):
 unit = store0.units[0]
 suggestions = review.get(Suggestion)()
 (suggestion, created_) = suggestions.add(unit, 'gras')
 first_hash = suggestion.target_hash
 suggestion.translator_comment = 'my nice comment'
 second_hash = suggestion.target_hash
 assert (first_hash != second_hash)
 suggestion.target = 'gras++'
 assert (first_hash != second_hash != suggestion.target_hash)

@ pytest . mark . django_db def test_hash ( store0 ) : unit = store0 . units [ 0 ] suggestions = review . get ( Suggestion ) ( ) ( suggestion , created_ ) = suggestions . add ( unit , 'gras' ) first_hash = suggestion . target_hash suggestion . translator_comment = 'my nice comment' second_hash = suggestion . target_hash assert ( first_hash != second_hash ) suggestion . target = 'gras++' assert ( first_hash != second_hash != suggestion . target_hash )
tests that target hash changes when suggestion is modified .