diff --git a/figures/management/commands/backfill_figures_daily_metrics.py b/figures/management/commands/backfill_figures_daily_metrics.py index 01142264..d60204b6 100644 --- a/figures/management/commands/backfill_figures_daily_metrics.py +++ b/figures/management/commands/backfill_figures_daily_metrics.py @@ -57,7 +57,7 @@ def handle(self, *args, **options): print('BEGIN: Backfill Figures daily metrics metrics for: {}'.format(dt)) kwargs = dict( - site_id=self.get_site_ids(options['site'])[0], + site_id=options['site'], date_for=str(dt), force_update=options['overwrite'] ) diff --git a/tests/test_commands.py b/tests/test_commands.py index 3387e319..ad1cc766 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -92,12 +92,10 @@ def test_backfill_daily_same_day(self): assert mock_populate.call_count == exp_days def test_backfill_daily_for_site(self): - """Test that proper site id gets passed to task func. Doesn't exercise get_side_ids.""" - with mock.patch('figures.management.base.BaseBackfillCommand.get_site_ids') as mock_get_site_ids: - mock_get_site_ids.return_value = [1,] - with mock.patch(self.PLAIN_PATH) as mock_populate: - call_command('backfill_figures_daily_metrics', no_delay=True) - assert mock_populate.called_with(site_id=1) + """Test that proper site id gets passed to task func.""" + with mock.patch(self.PLAIN_PATH) as mock_populate: + call_command('backfill_figures_daily_metrics', no_delay=True) + assert mock_populate.called_with(site_id=1) class TestPopulateFiguresMetricsCommand(object):