Permalink
Browse files

Create form for create project

  • Loading branch information...
1 parent 8308d7a commit 0bce8493fe995a710a2ec0eb19f5979f911a6342 @siminino siminino committed Jul 30, 2011
Showing with 17 additions and 0 deletions.
  1. +7 −0 startdust_website/projects/forms.py
  2. +10 −0 startdust_website/projects/tests.py
@@ -0,0 +1,7 @@
+from django.forms import ModelForm
+from projects.models import Project
+
+
+class ProjectForm(ModelForm):
+ class Meta:
+ model = Project
@@ -9,6 +9,7 @@
from django.test.client import RequestFactory
from projects.models import Project
from projects.views import add_project
+from projects.forms import ProjectForm
class ProjectModelTestCase(TestCase):
@@ -35,3 +36,12 @@ def test_add_project_should_return_status_code_200(self):
request = self.factory.get('/painel/projects/add/')
response = add_project(request)
self.assertEqual(response.status_code, 200)
+
+
+class ProjectFormTestCase(TestCase):
+
+ def test_project_form(self):
+ project_form = ProjectForm()
+ self.assertTrue(project_form['name'])
+ self.assertTrue(project_form['url'])
+ self.assertTrue(project_form['token'])

0 comments on commit 0bce849

Please sign in to comment.