Skip to content

Commit

Permalink
Added a test for when analytics are configured but disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
citruspi committed Jun 13, 2015
1 parent 271ec80 commit a27f7c1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,35 @@ def index():
return render_template('index.html')


@app.route('/disabled/')
def disabled():

app.config['ANALYTICS'] = {
'ENABLED': False,
'GAUGES': {
'SITE_ID': 'soV5eile3aiFi9E'
},
'GOOGLE_ANALYTICS': {
'ACCOUNT': 'wiengech9tiefuW',
},
'PIWIK': {
'BASE_URL': 'aeniki8pheiFiad',
'SITE_ID': 'uiP3eeKie6ohDo6',
},
'GOSQUARED': {
'UID': 'ahz1Nahqueorahw'
},
'CHARTBEAT': {
'UID': 'uiP3eeKie6ohDo6',
'DOMAIN': 'eeda8Otheefu5qu'
}
}

analytics.reload()

return render_template('index.html')


@app.route('/none/')
def none():

Expand Down
11 changes: 11 additions & 0 deletions test/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ def test_none(self):

self.assertEquals(response.data, expected)

def test_disabled(self):

self.test_app = app.test_client()

response = self.test_app.get('/disabled/')

expected = ""

self.assertEquals(response.data, expected)


def test_chartbeat(self):

self.test_app = app.test_client()
Expand Down

0 comments on commit a27f7c1

Please sign in to comment.