def testIPAdd(self): data = { 'source_reference': IP_REF, 'source': IP_SRC, 'ip_type': IP_TYPE, 'ip': IPADDR, 'analyst': TUSER_NAME, 'bucket_list': IP_BUCKET, 'ticket': IP_TICKET, } errors = [] (result, errors, retVal) = handlers.add_new_ip(data, rowData={}, request=self.factory, errors="") self.assertTrue(result) self.assertTrue(retVal['success'])
def setUp(self): prep_db() self.factory = RequestFactory() self.user = CRITsUser.objects(username=TUSER_NAME).first() self.user.save() data = { 'source_reference': IP_REF, 'source': IP_SRC, 'ip_type': IP_TYPE, 'ip': IPADDR, 'analyst': TUSER_NAME, 'bucket_list': IP_BUCKET, 'ticket': IP_TICKET, } errors = [] (result, errors, retVal) = handlers.add_new_ip(data, rowData={}, request=self.factory, errors="")
def setUp(self): prep_db() self.factory = RequestFactory() self.user = CRITsUser.objects(username=TUSER_NAME).first() self.user.sources.append(TSRC) self.user.save() data = { 'source_reference': IP_REF, 'source': IP_SRC, 'ip_type': IP_TYPE, 'ip': IPADDR, 'analyst': TUSER_NAME, 'bucket_list': IP_BUCKET, 'ticket': IP_TICKET, } errors = [] (result, errors, retVal) = handlers.add_new_ip(data, rowData={}, request=self.factory, errors="")