fix delete last label disassociate

* Inherit from mixin first in order to overwrite next inherited class
method, unattach.
* Also, fix up test and add test to ensure correct inheritance
This commit is contained in:
Chris Meyers
2016-06-29 16:46:13 -04:00
parent 6a6081dcf7
commit a57dca9786
4 changed files with 15 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ class TestDeleteLastUnattachLabelMixin:
view.unattach(mock_request, None, None)
super.unattach_validate.assert_called_with(mock_request, None, None)
super.unattach_validate.assert_called_with(mock_request)
super.unattach_by_id.assert_called_with(mock_request, mock_sub_id)
mock_label.is_detached.assert_called_with()
mock_label.objects.get.assert_called_with(id=mock_sub_id)
@@ -154,7 +154,7 @@ class TestDeleteLastUnattachLabelMixin:
res = view.unattach(mock_request, None, None)
super.unattach_validate.assert_called_with(mock_request, None, None)
super.unattach_validate.assert_called_with(mock_request)
assert mock_response == res
class TestParentMixin: