Package madrona :: Package group_management :: Module tests
[hide private]

Source Code for Module madrona.group_management.tests

 1  """ 
 2  This file demonstrates two different styles of tests (one doctest and one 
 3  unittest). These will both pass when you run "manage.py test". 
 4   
 5  Replace these with more appropriate tests for your application. 
 6  """ 
 7   
 8  from django.test import TestCase 
 9  from django.contrib.auth.models import Group, User 
10  from madrona.group_management.models import GroupRequest 
11   
12 -class GroupManagementTest(TestCase):
13 - def test_group_request(self):
14 """ 15 Tests that user can request membership with a group 16 """ 17 user1 = User.objects.create_user('user1', 'test@madrona.org', password='user1') 18 group1 = Group.objects.create(name="Test Group 1") 19 gr = GroupRequest(user=user1,group=group1) 20 gr.save() 21 gr1 = GroupRequest.objects.all() 22 self.assertEqual(len(gr1),1) 23 self.assertEqual(gr1[0].user, user1)
24