Skip to content

Commit

Permalink
Merge pull request #11 from garbados/master
Browse files Browse the repository at this point in the history
garbados added tests!
  • Loading branch information
skoczen committed Feb 22, 2012
2 parents 2028d17 + 892c850 commit 0b2a775
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions longerusername/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.contrib.auth.models import User
from django.test import TestCase

class LongerUsernameTests(TestCase):
"""
Unit tests for longerusername app
"""
def setUp(self):
"""
creates a user with a terribly long username
"""
long_username = ''.join([str(i) for i in range(100)])
self.user = User.objects.create_user('test' + long_username, 'test@test.com', 'testpassword')
def testUserCreation(self):
"""
tests that self.user was successfully saved, and can be retrieved
"""
self.assertNotEqual(self.user,None)
User.objects.get(id=self.user.id) # returns DoesNotExist error if the user wasn't created

0 comments on commit 0b2a775

Please sign in to comment.