Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unexcepted method call error when running the horizon unit test

class AlarmsViewTests(test.BaseAdminViewTests):
    @test.create_stubs({api.ceilometer: ('alarm_list',),})
    def test_index(self):
        api.ceilometer.alarm_list(IsA(http.HttpRequest), None) \
            .AndReturn(self.alarms.list())
        self.mox.ReplayAll()
        pdb.set_trace()
        res = self.client.get(reverse(constants.ALARMS_INDEX_URL))
        self.assertTemplateUsed(res, constants.ALARMS_TEMPLATE_NAME)
        self.assertItemsEqual(res.context['table'].data, self.alarms.list())

after the self.client.get() i get the error. ALARMS_INDEX_URL is correctly defined