66from django .test .client import Client
77from ietf .group .models import Group
88from ietf .ietfauth .decorators import has_role
9+ from ietf .utils .test_data import make_test_data
910from ietf .utils .test_utils import SimpleUrlTestCase , RealDatabaseTest
1011from ietf .idtracker .models import Role
1112
1213from urlparse import urlsplit
13- from pyquery import PyQuery
14+ #from pyquery import PyQuery
15+
16+ SEC_USER = 'secretary'
1417
1518class SreqUrlTestCase (SimpleUrlTestCase ):
1619 def testUrls (self ):
1720 self .doTestUrls (__file__ )
1821
19- """
20- SEC_USER='rcross'
21- WG_USER=''
22- AD_USER=''
23-
2422class MainTestCase (TestCase ):
25- fixtures = ['names',
26- 'test-meeting',
27- 'test-group',
28- 'test-person',
29- 'test-user',
30- 'test-email',
31- 'test-role']
23+ fixtures = ['names' ]
3224
33- # ------- Test View -------- #
3425 def test_main (self ):
26+ draft = make_test_data ()
3527 url = reverse ('sessions' )
3628 r = self .client .get (url ,REMOTE_USER = SEC_USER )
3729 self .assertEquals (r .status_code , 200 )
38- #assert False, (r.context)
3930 sched = r .context ['scheduled_groups' ]
4031 unsched = r .context ['unscheduled_groups' ]
4132 self .failUnless (len (sched ) == 0 )
42- self.failUnless(len(unsched) == 5)
43- #ancp = Group.objects.get(acronym='ancp')
44- paws = Group.objects.get(acronym='paws')
45- #self.failUnless(ancp in sched)
46- self.failUnless(paws in unsched)
47- #assert False, r.content
48- #user = User.objects.get(username='rcross')
49- #self.failUnless(has_role(user,'Secretariat'))
33+ self .failUnless (len (unsched ) > 0 )
5034
5135class SubmitRequestCase (TestCase ):
52- fixtures = ['names',
53- 'test-meeting',
54- 'test-group',
55- 'test-person',
56- 'test-user',
57- 'test-email',
58- 'test-role']
36+ fixtures = ['names' ]
5937
6038 def test_submit_request (self ):
61- url = reverse('sessions_new',kwargs={'acronym':'ancp'})
39+ draft = make_test_data ()
40+ acronym = Group .objects .all ()[0 ].acronym
41+ url = reverse ('sessions_new' ,kwargs = {'acronym' :acronym })
6242 post_data = {'id_num_session' :'1' ,
6343 'id_length_session1' :'3600' ,
6444 'id_attendees' :'10' ,
65- 'id_conflict1':'core ',
45+ 'id_conflict1' :'' ,
6646 'id_comments' :'need projector' }
67- self.client.login(remote_user='rcross' )
47+ self .client .login (remote_user = SEC_USER )
6848 r = self .client .post (url ,post_data )
6949 self .assertEquals (r .status_code , 200 )
50+ """
7051 #assert False, self.client.session..__dict__
7152
72- url = reverse('sessions_confirm',kwargs={'acronym':'ancp' })
53+ url = reverse('sessions_confirm',kwargs={'acronym':acronym })
7354 #s = self.client.session
7455 #s['session_form'] = post_data
7556 r = self.client.get(url)
7657 assert False, r.content
77-
58+ """
7859class EditRequestCase (TestCase ):
7960 pass
8061
@@ -89,5 +70,4 @@ class RetrievePreviousCase(TestCase):
8970 # test error if already scheduled
9071 # test get previous exists/doesn't exist
9172 # test that groups scheduled and unscheduled add up to total groups
92- # test locking function, access by unauthorized
93- """
73+ # test locking function, access by unauthorized
0 commit comments