Skip to content

Commit

Permalink
Made changes requested in pull request stephenmcd#48 - issue stephenm…
Browse files Browse the repository at this point in the history
  • Loading branch information
jnkwrych authored and tebica committed Jul 3, 2017
1 parent 0343870 commit 2269a94
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 42 deletions.
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ Running the tests
=================
Install the dependencies specified in requirements.txt and run::

python runtests.py

python setup.py test


Donating
Expand Down
39 changes: 38 additions & 1 deletion drum/links/tests/tests_models.py → drum/links/tests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,46 @@
from unittest import TestCase

from drum.links.forms import LinkForm
from django.contrib.auth.models import User
from drum.links.models import Link, Profile


class LinkFormsTests(TestCase):

def test_valid_data(self):
form = LinkForm({
"title": "Test title",
"link": "http://test.com/",
"description": "Test Desc",
})
self.assertTrue(form.is_valid())

def test_title_may_not_be_empty(self):
form = LinkForm({
"title": "",
"link": "http://test.com/",
"description": "Test Desc",
})
self.assertFalse(form.is_valid())

def test_link_may_be_empty(self):
form = LinkForm({
"title": "Test title",
"link": "",
"description": "Test Desc",
})
self.assertTrue(form.is_valid())

def test_description_may_be_empty(self):
form = LinkForm({
"title": "Test title",
"link": "http://test.com/",
"description": "",
})
self.assertTrue(form.is_valid())


class LinkModelsTests(TestCase):

def test_has_link_field(self):
l = Link()
self.assertTrue(hasattr(l, 'link'))
Expand All @@ -19,6 +55,7 @@ def test_has_comments_field(self):


class ProfileModelsTests(TestCase):

def setUp(self):
self.user = User.objects.create(username='user', password="notsosecure")
self.user.profile.website = "http://test.com/"
Expand Down
Empty file removed drum/links/tests/__init__.py
Empty file.
38 changes: 0 additions & 38 deletions drum/links/tests/tests_forms.py

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
zip_safe=False,
include_package_data=True,
packages=find_packages(),
test_suite="runtests.main",

install_requires=[
"mezzanine >= 4.2.0",
Expand Down

0 comments on commit 2269a94

Please sign in to comment.