test_models.py 774 Bytes
Newer Older
David Haynes's avatar
David Haynes committed
1
# Django Imports
David Haynes's avatar
David Haynes committed
2
from django.test import TestCase
3
from django.contrib.auth.models import User
David Haynes's avatar
David Haynes committed
4

David Haynes's avatar
David Haynes committed
5
6
# App Imports
from go.models import URL, RegisteredUser
David Haynes's avatar
David Haynes committed
7

David Haynes's avatar
David Haynes committed
8
9
10
"""
    Test cases for the URL Model
"""
David Haynes's avatar
David Haynes committed
11
class URLTest(TestCase):
David Haynes's avatar
David Haynes committed
12

David Haynes's avatar
David Haynes committed
13
14
15
    """
        Default test case, does not actually test anything
    """
David Haynes's avatar
David Haynes committed
16
    def test_Django_Test(self):
David Haynes's avatar
David Haynes committed
17
        self.assertEqual("Hello World!", "Hello World!")
David Haynes's avatar
David Haynes committed
18
19
20
21
22
23

"""
    Test cases for the RegisteredUser Model
"""
class RegisteredUserTest(TestCase):

24
25
26
27
28
29
30
    def setUp(self):
        User.objects.create(username='dhaynes', password='password')

    def test_RegisteredUserCreation(self):
        getUser = User.objects.get(username='dhaynes')
        getRegisteredUser = RegisteredUser.objects.get(user=getUser)
        self.assertTrue(getRegisteredUser)