-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
easymde: Vendor the editor instead of using unmaintained fork
Makes the dependencies clearer, avoid the dependency on setuptools which has been an issue with dependabot, and remove some unused support from the library, as well as using Python3-only helpers.
- Loading branch information
1 parent
f769f54
commit 7560511
Showing
11 changed files
with
73 additions
and
46 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
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,36 @@ | ||
from django import forms | ||
from pytest_django.asserts import assertHTMLEqual | ||
|
||
from itou.utils.widgets import EasyMDEEditor | ||
|
||
|
||
class TestEasyMDEEditor: | ||
def test_basic(self): | ||
class MyForm(forms.Form): | ||
description = forms.CharField(widget=EasyMDEEditor) | ||
|
||
form = MyForm() | ||
assertHTMLEqual( | ||
str(form), | ||
""" | ||
<div> | ||
<label for="id_description">Description :</label> | ||
<textarea class="easymde-box" cols="40" id="id_description" name="description" required rows="10"> | ||
</div> | ||
""", | ||
) | ||
|
||
def test_custom_class(self): | ||
class MyForm(forms.Form): | ||
description = forms.CharField(widget=EasyMDEEditor(attrs={"class": "foo"})) | ||
|
||
form = MyForm() | ||
assertHTMLEqual( | ||
str(form), | ||
""" | ||
<div> | ||
<label for="id_description">Description :</label> | ||
<textarea class="easymde-box foo" cols="40" id="id_description" name="description" required rows="10"> | ||
</div> | ||
""", | ||
) |