Skip to content
Browse files

Merge branch 'master' of git@git.pinaxproject.com:pinax

  • Loading branch information...
2 parents 092ad22 + d571437 commit f946c95ff55cad4dfc8f5fb5c636dac1880a12bc @jezdez jezdez committed Apr 23, 2009
View
60 pinax/apps/basic_profiles/fixtures/test_basic_profiles.json
@@ -0,0 +1,60 @@
+[
+ {
+ "pk": 1,
+ "model": "auth.user",
+ "fields": {
+ "username": "bob",
+ "first_name": "Bob",
+ "last_name": "Roberts",
+ "is_active": true,
+ "is_superuser": false,
+ "is_staff": false,
+ "last_login": "2009-03-31 19:11:56",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$a75af$7b2c7b5e7ac635e80477fece6291508d6af30b9d",
+ "email": "",
+ "date_joined": "2009-03-31 15:14:06"
+ }
+ },
+ {
+ "pk": 2,
+ "model": "auth.user",
+ "fields": {
+ "username": "joe",
+ "first_name": "Joe",
+ "last_name": "Smith",
+ "is_active": true,
+ "is_superuser": false,
+ "is_staff": false,
+ "last_login": "2009-03-31 19:11:56",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$a75af$7b2c7b5e7ac635e80477fece6291508d6af30b9d",
+ "email": "",
+ "date_joined": "2009-03-31 15:14:06"
+ }
+ },
+ {
+ "pk": 1,
+ "model": "basic_profiles.profile",
+ "fields": {
+ "user": 1,
+ "name": "Bob Roberts",
+ "about": "The problem with Bob is that he doesn't like beer",
+ "location": "Someplace dull",
+ "website": "http://pinaxproject.com"
+ }
+ },
+ {
+ "pk": 2,
+ "model": "basic_profiles.profile",
+ "fields": {
+ "user": 2,
+ "name": "Joe Smith",
+ "about": "Joe like beer",
+ "location": "Germany perhaps?",
+ "website": "http://djangoproject.com"
+ }
+ }
+]
View
1 pinax/apps/basic_profiles/tests/__init__.py
@@ -0,0 +1 @@
+from test_form import *
View
32 pinax/apps/basic_profiles/tests/test_form.py
@@ -0,0 +1,32 @@
+# coding: utf-8
+
+from django.contrib.auth.models import User
+from django.core.urlresolvers import reverse
+from django.test import TestCase
+
+from basic_profiles.forms import ProfileForm
+from basic_profiles.models import Profile
+
+
+
+class TestProfileForm(TestCase):
+ fixtures = ['test_basic_profiles.json']
+
+ def setUp(self):
+ self.user = User.objects.get(username='bob')
+ self.profile = Profile.objects.get(user=self.user)
+
+ def tearDown(self):
+ pass
+
+ def test_profile_form(self):
+ form = ProfileForm(instance=self.profile)
+ # include a bad url to force an error
+ data = {
+ "name": "John Smith",
+ "about": "John likes wine",
+ "location": "France maybe!",
+ "website": "httpasd://python.org"
+ }
+ form = ProfileForm(data)
+ self.assertEquals(False, form.is_valid())

0 comments on commit f946c95

Please sign in to comment.
Something went wrong with that request. Please try again.