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 test_create_model(self): job = Job.create( { 'title': 'this is a test', }) self.assertEquals('this is aest', job.title)
def index(request, project_id): jobs_ordered = Job.index(project_id) return HttpResponse(jobs_ordered, 'application/json')
def delete(request): job_data = request.POST print 'job_data', job_data job = Job.delete(job_data) return HttpResponse(job, 'application/json')
def mark_completed(request): job_data = request.POST job = Job.mark_completed(job_data) return HttpResponse(job, 'application/json')
def update(request): form_data = request.POST job = Job.update(form_data) return HttpResponse(job, 'application/json')