def testEquity(self): from jflow.db.instdata.utils import instrument_ct dd = {'code':'GOOG', 'content_type':instrument_ct('equity').id, 'curncy':'USD'} dd.update(data0) c = self.client response = c.get('/data/add/') self.assertEqual(response.status_code,200) response = c.post('/data/add/', dd) self.assertEqual(response.status_code,200) html = response.content self.assertTrue('id_CUSIP' in html) self.assertTrue('id_SEDOL' in html) self.assertTrue('id_exchange' in html) self.assertTrue('id_security_type' in html) self.assertTrue('id_multiplier' in html) self.assertTrue('id_settlement_delay' in html)
def testBond(self): from jflow.db.instdata.utils import instrument_ct dd = {'code':'DBR20', 'content_type':instrument_ct('bond').id, 'coupon': 5.675} dd.update(data0) c = self.client response = c.get('/data/add/') self.assertEqual(response.status_code,200) response = c.post('/data/add/', dd) self.assertEqual(response.status_code,200) html = response.content self.assertTrue('id_CUSIP' in html) self.assertTrue('id_SEDOL' in html) self.assertTrue('id_exchange' in html) self.assertTrue('id_bond_class' in html) self.assertTrue('id_coupon' in html) self.assertTrue('5.675' in html) self.assertTrue('id_announce_date' in html)
def testEquity(self): from jflow.db.instdata.utils import instrument_ct dd = { 'code': 'GOOG', 'content_type': instrument_ct('equity').id, 'curncy': 'USD' } dd.update(data0) c = self.client response = c.get('/data/add/') self.assertEqual(response.status_code, 200) response = c.post('/data/add/', dd) self.assertEqual(response.status_code, 200) html = response.content self.assertTrue('id_CUSIP' in html) self.assertTrue('id_SEDOL' in html) self.assertTrue('id_exchange' in html) self.assertTrue('id_security_type' in html) self.assertTrue('id_multiplier' in html) self.assertTrue('id_settlement_delay' in html)
def testBond(self): from jflow.db.instdata.utils import instrument_ct dd = { 'code': 'DBR20', 'content_type': instrument_ct('bond').id, 'coupon': 5.675 } dd.update(data0) c = self.client response = c.get('/data/add/') self.assertEqual(response.status_code, 200) response = c.post('/data/add/', dd) self.assertEqual(response.status_code, 200) html = response.content self.assertTrue('id_CUSIP' in html) self.assertTrue('id_SEDOL' in html) self.assertTrue('id_exchange' in html) self.assertTrue('id_bond_class' in html) self.assertTrue('id_coupon' in html) self.assertTrue('5.675' in html) self.assertTrue('id_announce_date' in html)
def instrument_ct(self, name): from jflow.db.instdata.utils import instrument_ct return instrument_ct(name)