def test_objective_with_invalid_fields(): entry = Entry() entry.how = 'this is how' entry.what = 'this is what' entry.something_not_right = 'this is not right' with pytest.raises(ValidationError): log_entry = LogEntry() log_entry.entry_type = 'objective' log_entry.entry = entry log_entry.save()