コード例 #1
0
ファイル: testInstitution.py プロジェクト: sarrionandia/taber
    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")
コード例 #2
0
ファイル: testInstitution.py プロジェクト: sarrionandia/taber
    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)