diff options
-rw-r--r-- | test.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2302,11 +2302,11 @@ class ReportStoreTest(WebMockTestCase): | |||
2302 | def test_to_json(self): | 2302 | def test_to_json(self): |
2303 | report_store = market.ReportStore(self.m) | 2303 | report_store = market.ReportStore(self.m) |
2304 | report_store.logs.append({"foo": "bar"}) | 2304 | report_store.logs.append({"foo": "bar"}) |
2305 | self.assertEqual('[{"foo": "bar"}]', report_store.to_json()) | 2305 | self.assertEqual('[\n {\n "foo": "bar"\n }\n]', report_store.to_json()) |
2306 | report_store.logs.append({"date": portfolio.datetime(2018, 2, 24)}) | 2306 | report_store.logs.append({"date": portfolio.datetime(2018, 2, 24)}) |
2307 | self.assertEqual('[{"foo": "bar"}, {"date": "2018-02-24T00:00:00"}]', report_store.to_json()) | 2307 | self.assertEqual('[\n {\n "foo": "bar"\n },\n {\n "date": "2018-02-24T00:00:00"\n }\n]', report_store.to_json()) |
2308 | report_store.logs.append({"amount": portfolio.Amount("BTC", 1)}) | 2308 | report_store.logs.append({"amount": portfolio.Amount("BTC", 1)}) |
2309 | self.assertEqual('[{"foo": "bar"}, {"date": "2018-02-24T00:00:00"}, {"amount": "1.00000000 BTC"}]', report_store.to_json()) | 2309 | self.assertEqual('[\n {\n "foo": "bar"\n },\n {\n "date": "2018-02-24T00:00:00"\n },\n {\n "amount": "1.00000000 BTC"\n }\n]', report_store.to_json()) |
2310 | 2310 | ||
2311 | @mock.patch.object(market.ReportStore, "print_log") | 2311 | @mock.patch.object(market.ReportStore, "print_log") |
2312 | @mock.patch.object(market.ReportStore, "add_log") | 2312 | @mock.patch.object(market.ReportStore, "add_log") |