#1871 Fix deleting tickets that have a tag attached
Merged by pingou. Opened by pingou.
delete_issue  into  master

Download 1871.patch

We had a bug where we could not delete issues/tickets that had been
tagged because of a lack of propagation of the change at the DB level.

With this commit we can now safely delete issues/tickets that have been
tagged and we have unit-tests to prevent this from happening again.

1 new commit added

  • Enhance the unit-tests around deleting an issue

I wouldn't recommended changing this pattern in this PR since it's not related to this change, but a suggestion to consider for later: Bodhi allows tests to be imported because they exist at bodhi.tests. This makes it easy for tests to import helper functions. Additionally, Bodhi's setup.py has an exclusion rule that prevents the tests from being installed. It's a nice way to go.

This test is long and is a bit difficult to follow as a result. I recommend breaking it into multiple smaller targeted tests that each test one condition. This will make each test easier to understand, and it will also allow them to fail independently which can help when debugging a problem down the road. The downside would likely be slower execution time.

I suppose a lot of what is happening is just setup here. Maybe the setup could be moved into a setUp() method to reduce the length of this test. It looks like there might be opportunities to share code with the next test if you took this route, which could make both of these easier to follow.

LGTM, you can take or leave my suggestions.

It could definitely be moved to setUp() but it feels odd to me to have assert calls in the set-up.

1 new commit added

  • Restructure the tests to rely a little more on setUp to reduce code duplication

rebased

LGTM!

Thanks :)

Pull-Request has been merged by pingou

Metadata