File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 10
10
from django .utils import timezone
11
11
from gidgethub import sansio
12
12
13
+ from .conf import app_settings
14
+
13
15
14
16
class EventAction (NamedTuple ):
15
17
event : str
@@ -166,9 +168,9 @@ def extract_mentions_from_event(
166
168
if not comment :
167
169
return []
168
170
169
- # If no pattern specified, use bot username (TODO: get from settings)
171
+ # If no pattern specified, use bot username from settings
170
172
if username_pattern is None :
171
- username_pattern = "bot" # Placeholder
173
+ username_pattern = app_settings . SLUG
172
174
173
175
mentions : list [ParsedMention ] = []
174
176
potential_mentions = extract_all_mentions (comment )
Original file line number Diff line number Diff line change 9
9
10
10
from django_github_app .mentions import Comment
11
11
from django_github_app .mentions import MentionScope
12
- from django_github_app .mentions import get_match
13
12
from django_github_app .mentions import extract_mentions_from_event
13
+ from django_github_app .mentions import get_match
14
+
15
+
16
+ @pytest .fixture (autouse = True )
17
+ def setup_test_app_name (override_app_settings ):
18
+ with override_app_settings (NAME = "bot" ):
19
+ yield
14
20
15
21
16
22
@pytest .fixture
Original file line number Diff line number Diff line change 14
14
from django_github_app .views import BaseWebhookView
15
15
16
16
17
+ @pytest .fixture (autouse = True )
18
+ def setup_test_app_name (override_app_settings ):
19
+ with override_app_settings (NAME = "bot" ):
20
+ yield
21
+
22
+
17
23
@pytest .fixture (autouse = True )
18
24
def test_router ():
19
25
import django_github_app .views
You can’t perform that action at this time.
0 commit comments