예제 #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)
예제 #2
0
def delete(request):
    project_data = request.POST
    project = Project.delete(project_data)
    return HttpResponse(project, "application/json")
예제 #3
0
def update(request):
    form_data = request.POST
    project = Project.update(form_data)
    return HttpResponse(project, "application/json")