Browse Source

Fixed tests

tags/0.1
Johann Schmitz 4 years ago
parent
commit
138f7faa99
Signed by: Johann Schmitz <johann@j-schmitz.net> GPG Key ID: A084064277C501ED
2 changed files with 3 additions and 1 deletions
  1. 1
    1
      src/pypiwik/tracker.py
  2. 2
    0
      tests/tracker.py

+ 1
- 1
src/pypiwik/tracker.py View File

@@ -149,7 +149,7 @@ class PiwikTracker(object):
if 'HTTP_X_FORWARDED_FOR' in meta:
return meta['real_ip'].split(",")[0]
else:
return meta['REMOTE_ADDR']
return meta.get('REMOTE_ADDR', None)

self.client_ip = _get_client_ip()


+ 2
- 0
tests/tracker.py View File

@@ -57,6 +57,8 @@ class TrackerTest(unittest.TestCase):
assert 'rec' in params and params['rec'] == '1', 'Wrong or missing "rec" parameter'

for property_name, parameter_name in PARAMETERS.items():
if not parameter_name:
continue
if property_name in ('page_custom_vars', 'visit_custom_vars'):
continue
assert parameter_name in params, "Parameter %s not found in dict" % parameter_name

Loading…
Cancel
Save