示例#1
0
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={})
示例#2
0
def test_report_view_has_no_errors():
    headers = {"HTTP_HOST": "getsaleor.com", "HTTP_REFERER": "example.com"}
    report_view("", "/test-path/", "en-us", headers)
示例#3
0
def test_report_view_has_no_errors():
    headers = {'HTTP_HOST': 'getsaleor.com', 'HTTP_REFERER': 'example.com'}
    report_view('', '/test-path/', 'en-us', headers)
示例#4
0
def test_report_view_has_no_errors():
    headers = {'HTTP_HOST': 'getsaleor.com', 'HTTP_REFERER': 'example.com'}
    report_view('', '/test-path/', 'en-us', headers)
示例#5
0
def test_report_view_has_no_errors():
    headers = {"HTTP_HOST": "getsaleor.com", "HTTP_REFERER": "example.com"}
    report_view("", "/test-path/", "en-us", headers)