def test_get_plot_data_filtered(self): '''Tests getting the metrics plot data with filters.''' strike = ingest_test_utils.create_strike() metrics_test_utils.create_ingest(strike=strike, occurred=datetime.datetime(2015, 1, 1), ingested_count=1) metrics_test_utils.create_ingest(strike=strike, occurred=datetime.datetime(2015, 1, 20), ingested_count=1) metrics_test_utils.create_ingest(occurred=datetime.datetime(2015, 1, 1), ingested_count=1) plot_data = MetricsIngest.objects.get_plot_data(started=datetime.date(2015, 1, 1), ended=datetime.date(2015, 1, 10), choice_ids=[strike.id], columns=[MetricsTypeColumn('ingested_count')]) self.assertEqual(len(plot_data), 1) self.assertEqual(len(plot_data[0].values), 1)
def test_get_plot_data_filtered(self): """Tests getting the metrics plot data with filters.""" strike = ingest_test_utils.create_strike() metrics_test_utils.create_ingest(strike=strike, occurred=datetime.datetime(2015, 1, 1, tzinfo=utc), ingested_count=1) metrics_test_utils.create_ingest(strike=strike, occurred=datetime.datetime(2015, 1, 20, tzinfo=utc), ingested_count=1) metrics_test_utils.create_ingest(occurred=datetime.datetime(2015, 1, 1, tzinfo=utc), ingested_count=1) plot_data = MetricsIngest.objects.get_plot_data(started=datetime.date(2015, 1, 1), ended=datetime.date(2015, 1, 10), choice_ids=[strike.id], columns=[MetricsTypeColumn('ingested_count')]) self.assertEqual(len(plot_data), 1) self.assertEqual(len(plot_data[0].values), 1)
def test_get_plot_data(self): """Tests getting the metrics plot data.""" metrics_test_utils.create_ingest(ingested_count=1) plot_data = MetricsIngest.objects.get_plot_data() self.assertGreater(len(plot_data), 1)
def test_get_plot_data(self): '''Tests getting the metrics plot data.''' metrics_test_utils.create_ingest(ingested_count=1) plot_data = MetricsIngest.objects.get_plot_data() self.assertGreater(len(plot_data), 1)