def testSourceCSVQuery(self): obj = TestSourceObject fields = "status,name,source,modified,value" data = { 'username': self.user.username, 'first_name': self.user.first_name, 'last_name': self.user.last_name, 'email': self.user.email, 'role': self.user.role, 'sources': [ TSRC, ], 'organization': TSRC, 'secret': '', 'subscriptions': [], 'totp': False, } handlers.modify_source_access(self.user.username, data) resp = handlers.csv_query(obj, self.user.username, fields=fields.split(',')) lines = resp.splitlines() item = lines[1].split(',') self.assertEqual(item[0], "New") self.assertEqual(item[1], TOBJS_NAME) self.assertEqual(item[2], TSRC) self.assertEqual(item[4], TOBJS_VALUE) self.assertEqual(lines[0], fields)
def testSourceCSVQuery(self): obj = TestSourceObject fields = "status,name,source,modified,value" data = {'username': self.user.username, 'first_name': self.user.first_name, 'last_name': self.user.last_name, 'email': self.user.email, 'role': self.user.role, 'sources': [TSRC, ], 'organization': TSRC, 'secret': '', 'subscriptions': [], 'totp': False, } handlers.modify_source_access(self.user.username, data) resp = handlers.csv_query(obj, self.user.username, fields=fields.split(',') ) lines = resp.splitlines() item = lines[1].split(',') self.assertEqual(item[0], "New") self.assertEqual(item[1], TOBJS_NAME) self.assertEqual(item[2], TSRC) self.assertEqual(item[4], TOBJS_VALUE) self.assertEqual(lines[0], fields)
def testCSVQuery(self): obj = TestObject fields = "status,name,campaign,modified,value" resp = handlers.csv_query(obj, self.user.username, fields=fields.split(',')) lines = resp.splitlines() item = lines[1].split(',') self.assertEqual(item[0], "New") self.assertEqual(item[1], TOBJ_NAME) self.assertEqual(item[4], TOBJ_VALUE) self.assertEqual(lines[0], fields)
def testCSVQuery(self): obj = TestObject fields = "status,name,campaign,modified,value" resp = handlers.csv_query(obj, self.user.username, fields=fields.split(',') ) lines = resp.splitlines() item = lines[1].split(',') self.assertEqual(item[0], "New") self.assertEqual(item[1], TOBJ_NAME) self.assertEqual(item[4], TOBJ_VALUE) self.assertEqual(lines[0], fields)