Ejemplo n.º 1
0
    def testDeleteRemovesObject(self):
        institution = generate_objects.valid_institution();
        institution.save()
        institution_id = institution.id

        view = DeleteInstitutionView()
        view.post(None, institution_id)

        self.assertEqual(0, Institution.objects.filter(id=institution_id).count(), "Didn't delete institution")
Ejemplo n.º 2
0
    def testInstitutionDoesntExist(self):
        institution = generate_objects.valid_institution()
        institution.save()
        institution_id = institution.id

        institution.delete()

        with self.assertRaises(Http404):
            view = DeleteInstitutionView()
            view.post(None, institution_id)