def test_create_model(self): p = Project() p.user_id = 'andree' p.title = 'my project' p.details = 'details' p.save() p = Project.objects.all() job = Job.create( { 'title': 'this is a test', 'project_id': 1, 'note':'this is a note', 'assign_to':'Andree', 'due_date': '' }) self.assertEquals('this is a test', job.title) self.assertEqual('this is a note', job.note) self.assertEquals('Andree', job.assign_to) self.assertEquals(True, type(job.order)==int)
def delete(request): project_data = request.POST project = Project.delete(project_data) return HttpResponse(project, "application/json")
def update(request): form_data = request.POST project = Project.update(form_data) return HttpResponse(project, "application/json")