예제 #1
0
 def test_id_exist(self):
     self.predictResult = [{
         'id': 1,
         'name': 'chain1',
     }, {
         'id': 2,
         'name': 'chain2',
     }]
     self.realResult = getChainList(self.project.pk)
     self.assertEqual(cmp(self.realResult, self.predictResult), 0)
예제 #2
0
 def test_id_exist(self):
     self.predictResult = [{
     'id':1,
     'name':'chain1',
     },{
     'id':2,
     'name':'chain2',
     }]
     self.realResult = getChainList(self.project.pk)
     self.assertEqual(cmp(self.realResult,self.predictResult),1)
예제 #3
0
def getProjectChains(request):
    projectId = request.GET.get('id','')
    result = getChainList(int(projectId))
    return HttpResponse(json.dumps(result), content_type="application/json")
예제 #4
0
 def test_id_null(self):
     self.predictResult = []
     self.realResult = getChainList(None)
     self.assertEqual(cmp(self.realResult, self.predictResult), 0)
예제 #5
0
 def test_id_not_exist(self):
     self.predictResult = []
     self.realResult = getChainList(5)
     self.assertEqual(cmp(self.realResult, self.predictResult), 0)
예제 #6
0
 def test_id_null(self):
     self.predictResult = []
     self.realResult = getChainList(None)
     self.assertEqual(cmp(self.realResult,self.predictResult),0)
예제 #7
0
 def test_id_not_exist(self):
     self.predictResult = []
     self.realResult = getChainList(5)
     self.assertEqual(cmp(self.realResult,self.predictResult),0)