Skip to content

Commit

Permalink
Ensure test_url_for is only used during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RishiDiwanTT committed Aug 30, 2023
1 parent aecc464 commit 127b5bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/feed_protocol/annotator/circulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import copy
import datetime
import logging
import os
import urllib.error
import urllib.parse
import urllib.request
Expand Down Expand Up @@ -239,7 +240,7 @@ def lane_url(self, lane: WorkList) -> str:
return self.feed_url(lane)

def url_for(self, *args: Any, **kwargs: Any) -> str:
if not has_request_context():
if not has_request_context() and os.environ.get("TESTING", False):
new_kwargs = {}
for k, v in list(kwargs.items()):
if not k.startswith("_"):
Expand Down

0 comments on commit 127b5bb

Please sign in to comment.