Improve the catalog tests
There's a lot of coverage missing in the catalog management command, and we've seen errors in there that would have been caught by tests (e.g oprions
).
In addition, there's a lot of cargo-culting of the very inelegant succession of multiple f.write(...)
calls.
Let's fix all that.