def test_get_view_payloads(mocked_ga_report, settings): settings.GOOGLE_ANALYTICS_TRACKING_ID = "ga_id" headers = {"HTTP_HOST": "getsaleor.com", "HTTP_REFERER": "example.com"} report_view("dummy_client_id", "/test-path/", "en-us", headers) expected_payload = [{ "t": "pageview", "dp": "/test-path/", "dh": "getsaleor.com", "dr": "example.com", "ul": "en-us", }] mocked_ga_report.assert_called_once_with("ga_id", "dummy_client_id", expected_payload, extra_headers={})
def test_report_view_has_no_errors(): headers = {"HTTP_HOST": "getsaleor.com", "HTTP_REFERER": "example.com"} report_view("", "/test-path/", "en-us", headers)
def test_report_view_has_no_errors(): headers = {'HTTP_HOST': 'getsaleor.com', 'HTTP_REFERER': 'example.com'} report_view('', '/test-path/', 'en-us', headers)