Exemplo n.º 1
0
 def test_reporting(self):
     """
     Test email reporting for sites
     """
     settings.INFLUX_DB = self._influx_db_name
     get_aggregate_daily_data()
     send_reports("day")
     self.assertEqual(len(mail.outbox),1)
 def test_data_aggregation(self):
     """
     Test data aggregation and daily_data_point creations
     """
     get_aggregate_daily_data()
     ddp = Daily_Data_Point.objects.all()
     self.assertEqual(ddp.count(), 1)
     ddp = ddp.first()
     self.assertNotEqual(ddp.daily_pv_yield, 0)
     self.assertNotEqual(ddp.daily_power_consumption_total, 0)
     self.assertNotEqual(ddp.daily_grid_usage, 0)
 def test_data_aggregation(self):
     """
     Test data aggregation and daily_data_point creations
     """
     get_aggregate_daily_data()
     ddp = Daily_Data_Point.objects.all()
     self.assertEqual(ddp.count(),1)
     ddp = ddp.first()
     self.assertNotEqual(ddp.daily_pv_yield,0)
     self.assertNotEqual(ddp.daily_power_consumption_total,0)
     self.assertNotEqual(ddp.daily_grid_usage,0)
    def test_data_point_creation(self):
        """
        Test all the DP were created in MYSQL and INFLUX
        """
        dps = Data_Point.objects.filter(site=self.site)
        self.assertNotEqual(dps.count(), 0)
        sleep(2)
        num_point = len(self.i.query("pv_production"))
        self.assertNotEqual(num_point, 0)

        #get aggregate daily data
        get_aggregate_daily_data()
    def test_data_point_creation(self):
        """
        Test all the DP were created in MYSQL and INFLUX
        """
        dps = Data_Point.objects.filter(site=self.site)
        self.assertNotEqual(dps.count(), 0)
        sleep(2)
        num_point = len(self.i.query("pv_production"))
        self.assertNotEqual(num_point,0)

        #get aggregate daily data
        get_aggregate_daily_data()