Ejemplo n.º 1
0
    def test_configure_ids(self):
        config = {'googleanalytics.ids': 'UA-TEST-1 UA-TEST-2'}
        analytics = GA()
        GA().configure(config)

        assert all(id in analytics.googleanalytics_ids
                   for id in ['UA-TEST-1', 'UA-TEST-2'])
Ejemplo n.º 2
0
    def test_configure_js_url(self):
        config = {'googleanalytics.ids': 'UA-TEST-1 UA-TEST-2'}
        analytics = GA()
        GA().configure(config)

        assert analytics.googleanalytics_javascript_url \
            == '/scripts/ckanext-googleanalytics.js'
Ejemplo n.º 3
0
    def test_get_helpers(self):

        assert inspect.ismethod(
            GA().get_helpers()['googleanalyticsbasic_header'])
Ejemplo n.º 4
0
    def test_configure_ids_not_present(self):
        config = {}
        analytics = GA()
        GA().configure(config)

        assert analytics.googleanalytics_ids == []