-
Notifications
You must be signed in to change notification settings - Fork 0
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 #7 from tbrlpld/improve-docs
Improve docs
- Loading branch information
Showing
9 changed files
with
711 additions
and
96 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
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
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,29 @@ | ||
"""Utilities for tests in the `laces` package.""" | ||
|
||
from django.forms import widgets | ||
|
||
|
||
class MediaAssertionMixin: | ||
@staticmethod | ||
def assertMediaEqual(first: widgets.Media, second: widgets.Media) -> bool: | ||
""" | ||
Compare two `Media` instances. | ||
The `Media` class does not implement `__eq__`, but its `__repr__` shows how to | ||
recreate the instance. | ||
We can use this to compare two `Media` instances. | ||
Parameters | ||
---------- | ||
first : widgets.Media | ||
First `Media` instance. | ||
second : widgets.Media | ||
Second `Media` instance. | ||
Returns | ||
------- | ||
bool | ||
Whether the two `Media` instances are equal. | ||
""" | ||
return repr(first) == repr(second) |