def test_get_withsync(self, rf): actionitem = ActionItem.objects.create(description='dummy description') get_request = rf.get('/') actionitemupdateview = ActionItemUpdateView() actionitemupdateview.kwargs = {'pk' : actionitem.pk, 'sync': 'sync'} actionitemupdateview.request = get_request response = actionitemupdateview.get(get_request) # This is perhaps not the best way of confirming that the sync method was called, but its a start assert response.context_data['actionitem'].description == actionitem.description + ' sync'
def test_get_success_url(self): actionitemupdateview = ActionItemUpdateView() actionitemupdateview.kwargs = {'pk' : 1} url = actionitemupdateview.get_success_url() assert url._proxy____args[0] == 'actionitems_update'