Skip to content

Commit

Permalink
Merge 3a46774 into fb99d00
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyppo committed Feb 23, 2016
2 parents fb99d00 + 3a46774 commit ef1cd5c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion flask_analytics/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def bootstrap(self):
'ENABLED': True
}

args = self.provider_map[provider].__init__.func_code.co_varnames
args = self.provider_map[provider].__init__.__code__.co_varnames
args = [arg for arg in args if arg != 'self']

for arg in args:
Expand Down
22 changes: 14 additions & 8 deletions test/test_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
import re
from app import app, analytics

class TestAnalytics(unittest.TestCase):
Expand Down Expand Up @@ -41,7 +42,7 @@ def test_none(self):

expected = ""

self.assertEquals(response.data, expected)
self.assertEquals(response.data, expected.encode('utf8'))

def test_disabled(self):

Expand All @@ -51,7 +52,7 @@ def test_disabled(self):

expected = ""

self.assertEquals(response.data, expected)
self.assertEquals(response.data, expected.encode('utf8'))


def test_chartbeat(self):
Expand Down Expand Up @@ -81,7 +82,7 @@ def test_chartbeat(self):
})();
</script>"""

self.assertEquals(response.data, expected)
self.assertEquals(response.data, expected.encode('utf8'))

def test_gosquared(self):

Expand All @@ -98,7 +99,7 @@ def test_gosquared(self):
_gs('ahz1Nahqueorahw');
</script>"""

self.assertEquals(response.data, expected)
self.assertEquals(response.data, expected.encode('utf8'))

def test_piwik(self):

Expand All @@ -119,7 +120,7 @@ def test_piwik(self):
})();
</script>"""

self.assertEquals(response.data, expected)
self.assertEquals(response.data, expected.encode('utf8'))

def test_gauges(self):

Expand All @@ -141,7 +142,7 @@ def test_gauges(self):
})();
</script>"""

self.assertEquals(response.data, expected)
self.assertEquals(response.data, expected.encode('utf8'))

def test_google(self):

Expand All @@ -163,7 +164,7 @@ def test_google(self):
</script>"""

self.assertEquals(response.data, expected)
self.assertEquals(response.data, expected.encode('utf8'))

def test_all(self):

Expand Down Expand Up @@ -238,4 +239,9 @@ def test_all(self):
})();
</script>"""

self.assertEquals(response.data, expected)


response_sections = sorted(re.split('<|>',str(response.data)))
expected_sections = sorted(re.split('<|>',str(expected.encode('utf'))))

self.assertEquals(response_sections, expected_sections)

0 comments on commit ef1cd5c

Please sign in to comment.