If an attachment insert fails, throw an exception rather than silently ignoring it.
Solve the problem where running the tests were throwing an exception.  Solved by making the test more like the ObjectiveC version of the test.

Exception details: Error inserting type=text/plain filename=test_attachment sequence=2 revpos=1
Reformat code and remove unneeded comment (no code change)
Merge branch 'refs/heads/fix_attachment_exception'