Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Apply rename
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Jul 9, 2021
1 parent db92155 commit 725eaaf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/app/test_phone_stats_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_r30v2_minimum_usage(self):
# Advance 31 days.
# (R30v2 includes users with **more** than 30 days between the two visits,
# and user_daily_visits records the timestamp as the start of the day.)
self.reactor.advance(31 * DAY)
self.reactor.advance(31 * ONE_DAY_IN_SECONDS)
# Also advance 10 minutes to let another user_daily_visits update occur
self.reactor.advance(600)

Expand All @@ -175,7 +175,7 @@ def test_r30v2_minimum_usage(self):
)

# Advance to JUST under 60 days after the user's first post
self._advance_to(first_post_at + 60 * DAY - 5)
self._advance_to(first_post_at + 60 * ONE_DAY_IN_SECONDS - 5)
self.reactor.advance(1)

# Check the user is still counted.
Expand All @@ -185,7 +185,7 @@ def test_r30v2_minimum_usage(self):
)

# Advance into the next day. The user's first activity is now more than 60 days old.
self._advance_to(first_post_at + 60 * DAY + 5)
self._advance_to(first_post_at + 60 * ONE_DAY_IN_SECONDS + 5)

# Check the user is now no longer counted in R30.
r30_results = self.get_success(self.hs.get_datastore().count_r30v2_users())
Expand Down Expand Up @@ -225,7 +225,7 @@ def test_r30v2_user_must_be_retained_for_at_least_a_month(self):

for _ in range(30):
# This loop posts a message every day for 30 days
self.reactor.advance(DAY - 400)
self.reactor.advance(ONE_DAY_IN_SECONDS - 400)
self.helper.send(
room_id, "I'm still here", tok=access_token, custom_headers=headers
)
Expand All @@ -240,7 +240,7 @@ def test_r30v2_user_must_be_retained_for_at_least_a_month(self):

# (This advance needs to be split up into multiple advances
# because otherwise strict inequality hits.)
self.reactor.advance(DAY)
self.reactor.advance(ONE_DAY_IN_SECONDS)
self.helper.send(
room_id, "Still here!", tok=access_token, custom_headers=headers
)
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_r30v2_returning_dormant_users_not_counted(self):
self.helper.send(room_id, "message", tok=access_token, custom_headers=headers)

# the user goes inactive for 2 months
self.reactor.advance(60 * DAY)
self.reactor.advance(60 * ONE_DAY_IN_SECONDS)

# the user returns for one day, perhaps just to check out a new feature
self.helper.send(room_id, "message", tok=access_token, custom_headers=headers)
Expand All @@ -300,7 +300,7 @@ def test_r30v2_returning_dormant_users_not_counted(self):
# Now we want to check that the user will still be able to appear in
# R30v2 as long as the user performs some other activity between
# 30 and 60 days later.
self.reactor.advance(32 * DAY)
self.reactor.advance(32 * ONE_DAY_IN_SECONDS)
self.helper.send(room_id, "message", tok=access_token, custom_headers=headers)

# (give time for tables to update)
Expand All @@ -313,7 +313,7 @@ def test_r30v2_returning_dormant_users_not_counted(self):
)

# Advance to 59.5 days after the user's first R30v2-eligible activity.
self.reactor.advance(27.5 * DAY)
self.reactor.advance(27.5 * ONE_DAY_IN_SECONDS)

# Check the user still appears in R30v2.
r30_results = self.get_success(self.hs.get_datastore().count_r30v2_users())
Expand All @@ -322,7 +322,7 @@ def test_r30v2_returning_dormant_users_not_counted(self):
)

# Advance to 60.5 days after the user's first R30v2-eligible activity.
self.reactor.advance(DAY)
self.reactor.advance(ONE_DAY_IN_SECONDS)

# Check the user no longer appears in R30v2.
r30_results = self.get_success(self.hs.get_datastore().count_r30v2_users())
Expand Down

0 comments on commit 725eaaf

Please sign in to comment.