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