Ejemplo n.º 1
0
    def test_to_json(self):
        overall_pos = OverallPos()
        overall_pos.save_raw_data(date=test_date, raw_overall=test_raw_overall)

        json_data = overall_pos.to_json()

        print json_data
Ejemplo n.º 2
0
    def save_overall(self):
        """
        save overall data into db
        only one overall in one day
        """
        overall_pos = OverallPos()
        overall_pos.save_raw_data(date=self.date, raw_overall=self.overall)

        return overall_pos.id
Ejemplo n.º 3
0
    def test_save_raw_data(self):
        overall_pos = OverallPos()
        overall_pos.save_raw_data(date=test_date, raw_overall=test_raw_overall)

        print 'Inserted IDs: %s' % overall_pos.id
        print 'option row count in db: %d\n' % len(OverallPos.objects.all())
        print 'Overall Data:'
        print overall_pos

        self.assertTrue(overall_pos.id)
        self.assertEqual(len(OverallPos.objects.all()), 1)