"""Unit tests for aggregate_stats models layer.""" from unittest.mock import patch from analytics.consts import analytics from analytics.models import aggregate_stats @patch('sukimu.schema.Schema.fetch') def test_fetching_data(monkeypatch): """Test fetching data on existing index.""" label_id = 'someid' transaction_type = 'randomtransaction' aggregate_stats.fetch( analytics.EntityTypes.LABEL, label_id, transaction_type, ('2014-10-01', '2015-01-01')) assert aggregate_stats.aggregate_analytics.fetch.called def test_check_types(): """Test the behavior of the check types method.""" assert aggregate_stats.check_type(analytics.EntityTypes.LABEL) assert not aggregate_stats.check_type('Random')