class TestVariables(TestCase): def setUp(self): self.VCT = VEDACat() def test_config(self): self.assertTrue(len(self.VCT.veda_model) > 0) def test_institution_valid(self): self.VCT.inst_code = '111' self.assertTrue(self.VCT.institution_name() == 'Error')
class TestVariables(unittest.TestCase): def setUp(self): self.VCT = VEDACat() def test_config(self): self.assertTrue(len(self.VCT.veda_model) > 0) def test_institution_valid(self): self.VCT.inst_code = '111' self.assertTrue(self.VCT.institution_name() == 'Error')
def institution_name(request): if request.method == 'POST' and request.POST['input_text'] != 'NEWINST': inst_code = request.POST['input_text'] VC1 = VEDACat(inst_code=inst_code) institution_name = VC1.institution_name() else: institution_name = '' return HttpResponse(json.dumps(institution_name), content_type="application/json")
def institution_name(request): if request.method == 'POST' and request.POST['input_text'] != 'NEWINST': inst_code = request.POST['input_text'] print inst_code VC1 = VEDACat(inst_code=inst_code) institution_name = VC1.institution_name() else: institution_name = '' return HttpResponse( json.dumps(institution_name), content_type="application/json" )