goodbye1")
self.assertEqual(response[2]["value"], 1)
elements = self.client.get("/api/paths/elements/").json()
- self.assertEqual(elements[0]["name"], "
hello1")
- self.assertEqual(len(elements), 4)
+ self.assertEqual(elements[4]["name"], " goodbye1")
+ self.assertEqual(len(elements), 5)
def test_paths_properties_filter(self):
person_factory(team_id=self.team.pk, distinct_ids=["person_1"])
@@ -364,7 +368,7 @@ def test_paths_properties_filter(self):
filter = PathFilter(data={"properties": [{"key": "$browser", "value": "Chrome", "type": "event"}]})
- response = paths().run(team=self.team, filter=filter)
+ response = paths(team=self.team, filter=filter).run(team=self.team, filter=filter)
self.assertEqual(response[0]["source"], "1_/")
self.assertEqual(response[0]["target"], "2_/about")
@@ -433,9 +437,8 @@ def test_paths_start(self):
response = self.client.get("/api/insight/path/?type=%24pageview&start=%2Fpricing").json()
- response = paths().run(
- team=self.team, filter=PathFilter(data={"path_type": "$pageview", "start_point": "/pricing"}),
- )
+ filter = PathFilter(data={"path_type": "$pageview", "start_point": "/pricing"})
+ response = paths(team=self.team, filter=filter).run(team=self.team, filter=filter,)
self.assertEqual(len(response), 5)
@@ -445,9 +448,8 @@ def test_paths_start(self):
self.assertTrue(response[3].items() >= {"source": "2_/about", "target": "3_/pricing", "value": 1}.items())
self.assertTrue(response[4].items() >= {"source": "3_/pricing", "target": "4_/help", "value": 1}.items())
- response = paths().run(
- team=self.team, filter=PathFilter(data={"path_type": "$pageview", "start_point": "/"}),
- )
+ filter = PathFilter(data={"path_type": "$pageview", "start_point": "/"})
+ response = paths(team=self.team, filter=filter).run(team=self.team, filter=filter,)
self.assertEqual(len(response), 3)
@@ -475,8 +477,8 @@ def test_paths_in_window(self):
event_factory(
properties={"$current_url": "/about"}, distinct_id="person_1", event="$pageview", team=self.team,
)
-
- response = paths().run(team=self.team, filter=PathFilter(data={"date_from": "2020-04-13"}))
+ filter = PathFilter(data={"date_from": "2020-04-13"})
+ response = paths(team=self.team, filter=filter).run(team=self.team, filter=filter)
self.assertEqual(response[0]["source"], "1_/")
self.assertEqual(response[0]["target"], "2_/about")