-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate version dropdown code and fix library detail dropdown (#1498
- Loading branch information
1 parent
350119e
commit f85c533
Showing
5 changed files
with
11 additions
and
54 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
from ..forms import LibraryForm, VersionSelectionForm | ||
from ..forms import LibraryForm | ||
|
||
|
||
def test_library_form_success(tp, library, category): | ||
form = LibraryForm(data={"categories": [category]}) | ||
assert form.is_valid() is True | ||
|
||
|
||
def test_version_selection_form(library_version): | ||
# Test with a valid version | ||
valid_version = library_version.version | ||
form = VersionSelectionForm(data={"version": valid_version.pk}) | ||
assert form.is_valid() | ||
|
||
# Test with an invalid version | ||
form = VersionSelectionForm(data={"version": 9999}) | ||
assert form.is_valid() is False | ||
|
||
# Test with no version selected | ||
form = VersionSelectionForm(data={"version": None}) | ||
assert form.is_valid() is False |
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