-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2570 from carpentries/feature/add-eventbrite-ques…
…tion Instructor Training application - add question about Eventbrite URL and associated filter
- Loading branch information
Showing
13 changed files
with
305 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import re | ||
|
||
from django import template | ||
|
||
from extrequests.utils import EVENTBRITE_URL_PATTERN | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag | ||
def url_matches_eventbrite_format(url: str) -> bool: | ||
match = re.search(EVENTBRITE_URL_PATTERN, url) | ||
return match is not None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ def setUp(self) -> None: | |
person=self.ironman, | ||
review_process="preapproved", | ||
member_code=self.membership.registration_code, | ||
eventbrite_url="https://www.eventbrite.com/e/711575811407", | ||
personal="Tony", | ||
family="Stark", | ||
email="[email protected]", | ||
|
@@ -112,6 +113,7 @@ def test_fields(self): | |
"invalid_member_code", | ||
"affiliation", | ||
"location", | ||
"eventbrite_id", | ||
"order_by", | ||
}, | ||
) | ||
|
@@ -318,6 +320,28 @@ def test_filter_location(self): | |
# Assert | ||
self.assertQuerysetEqual(result, [self.request_ironman]) | ||
|
||
def test_filter_eventbrite_id__digits(self): | ||
# Arrange | ||
name = "eventbrite_id" | ||
value = "1407" | ||
|
||
# Act | ||
result = self.filterset.filters[name].filter(self.qs, value) | ||
|
||
# Assert | ||
self.assertQuerysetEqual(result, [self.request_ironman]) | ||
|
||
def test_filter_eventbrite_id__url(self): | ||
# Arrange | ||
name = "eventbrite_id" | ||
value = "https://www.eventbrite.com/myevent?eid=711575811407" | ||
|
||
# Act | ||
result = self.filterset.filters[name].filter(self.qs, value) | ||
|
||
# Assert | ||
self.assertQuerysetEqual(result, [self.request_ironman]) | ||
|
||
def test_filter_order_by(self): | ||
# Arrange | ||
filter_name = "order_by" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.