Unverified Commit 550497bc authored by David Haynes's avatar David Haynes
Browse files

Finish first pass of tests on RegisteredUser model

- test the booleans so that things don't break
parent 47006dce
Pipeline #1084 passed with stage
in 55 seconds
......@@ -136,10 +136,77 @@ class RegisteredUserTest(TestCase):
# registered ---------------------------------------------------------------
def test_registered(self):
"""
test the registered bool
"""
get_user = User.objects.get(username='dhaynes')
get_registered_user = RegisteredUser.objects.get(user=get_user)
get_registered_user.registered = True
get_registered_user.save()
self.assertTrue(get_registered_user.registered)
def test_registered_default(self):
"""
test the registered bool
"""
get_user = User.objects.get(username='dhaynes')
get_registered_user = RegisteredUser.objects.get(user=get_user)
self.assertFalse(get_registered_user.registered)
# approved -----------------------------------------------------------------
def test_approved(self):
"""
test the approved bool
"""
get_user = User.objects.get(username='dhaynes')
get_registered_user = RegisteredUser.objects.get(user=get_user)
get_registered_user.approved = True
get_registered_user.save()
self.assertTrue(get_registered_user.approved)
def test_approved_default(self):
"""
test the approved bool default
"""
get_user = User.objects.get(username='dhaynes')
get_registered_user = RegisteredUser.objects.get(user=get_user)
self.assertFalse(get_registered_user.approved)
# blocked ------------------------------------------------------------------
def test_blocked(self):
"""
test the blocked bool
"""
get_user = User.objects.get(username='dhaynes')
get_registered_user = RegisteredUser.objects.get(user=get_user)
get_registered_user.blocked = True
get_registered_user.save()
self.assertTrue(get_registered_user.blocked)
def test_approved_default(self):
"""
test the blocked bool default
"""
get_user = User.objects.get(username='dhaynes')
get_registered_user = RegisteredUser.objects.get(user=get_user)
self.assertFalse(get_registered_user.blocked)
# __str__ ------------------------------------------------------------------
def test_check_str(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment