Skip to content

Commit

Permalink
Merge pull request #27 from pincoin/master
Browse files Browse the repository at this point in the history
bump to 0.0.0.3
  • Loading branch information
pincoin committed Feb 3, 2018
2 parents ed2d4e5 + 6185b51 commit 1d54b04
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django_summernote_ajax/__init__.py
@@ -1,4 +1,4 @@
version_info = (0, 0, 0, 2)
version_info = (0, 0, 0, 3)

__version__ = VERSION = '.'.join(map(str, version_info))
__project__ = PROJECT = 'django-summernote-ajax'
Expand Down
4 changes: 4 additions & 0 deletions django_summernote_ajax/forms.py
Expand Up @@ -13,6 +13,10 @@ class UploadAttachmentForm(forms.Form):

def clean_files(self):
content = self.cleaned_data['files']

if not content:
raise forms.ValidationError(_('Invalid file type'))

content_type = content.content_type.split('/')[0]
extension = splitext(content.name)[1][1:].lower()

Expand Down
2 changes: 2 additions & 0 deletions django_summernote_ajax/tests.py
Expand Up @@ -30,4 +30,6 @@ def test_summernote_widget(self):

# forms

# viewmixins

# views
12 changes: 11 additions & 1 deletion sandbox_app/tests.py
Expand Up @@ -72,7 +72,15 @@ def test_invalid_empty_post_attachment_form(self):
self.assertIn('summernote-widget', html)
self.assertFalse(form.is_valid())

# TODO: attachment form test (valid, empty list, over limit)
def test_valid_empty_post_attachment_form(self):
# empty list of attachment
pass

def test_valid_post_attachment_form(self):
pass

def test_over_max_post_attachment_form(self):
pass

def test_valid_post_admin_form(self):
post = Post.objects.get(id=1)
Expand All @@ -87,6 +95,8 @@ def test_invalid_post_admin_form(self):
self.assertIn('summernote-widget', html)
self.assertFalse(form.is_valid())

# viewmxins

# views
def test_user_is_not_authenticated(self):
user = auth.get_user(self.client)
Expand Down

0 comments on commit 1d54b04

Please sign in to comment.