writing tests for models