Permalink
Browse files

Fix simple test for account creation to work with custom user manager…

… and modify Travis config file to run test.
  • Loading branch information...
1 parent b869ece commit f17946f7f7581ef80f89b24d715133bd76f4c140 @jonathanchu committed Mar 19, 2013
Showing with 6 additions and 4 deletions.
  1. +1 −1 .travis.yml
  2. +5 −3 stashdaddy/accounts/tests.py
View
@@ -8,4 +8,4 @@ env:
before_script:
- psql -c 'create database stashdaddy;' -U postgres
script:
- # - "python manage.py test accounts"
+ - "python manage.py test accounts"
@@ -1,15 +1,17 @@
from django.test import TestCase
from django.test.client import Client
-from django.contrib.auth.models import User
+
+from .models import CustomUser as User
+
class ViewsTestCase(TestCase):
def setUp(self):
self.client = Client()
def test_MyView(self):
- User.objects.create_user('bradpitt', 'brad@pitt.com', 'mypassword')
+ User.objects.create_user('brad@pitt.com', 'mypassword')
# use test client to perform login
- user = self.client.login(username='bradpitt', password='mypassword')
+ user = self.client.login(username='brad@pitt.com', password='mypassword')
response = self.client.post('/accounts/profile/')

0 comments on commit f17946f

Please sign in to comment.