예제 #1
0
	def test_verify_votes(self):
		self.assertTrue(databaseManager.registerVote("some text pertaining to a vote", "kayush", self.passy[0]))
		self.assertTrue(databaseManager.registerVote("some text pertaining to a vote1", "kayush", self.passy[0]))
		self.assertTrue(databaseManager.registerVote("some text pertaining to a vote2", "kayush", self.passy[0]))
		self.assertEqual(len(Votes.objects.all()),3)
		val = databaseManager.verifyVote()
		self.assertTrue(val)
예제 #2
0
 def test_verify_votes(self):
     self.assertTrue(
         databaseManager.registerVote("some text pertaining to a vote",
                                      "kayush", self.passy[0]))
     self.assertTrue(
         databaseManager.registerVote("some text pertaining to a vote1",
                                      "kayush", self.passy[0]))
     self.assertTrue(
         databaseManager.registerVote("some text pertaining to a vote2",
                                      "kayush", self.passy[0]))
     self.assertEqual(len(Votes.objects.all()), 3)
     val = databaseManager.verifyVote()
     self.assertTrue(val)
예제 #3
0
import os
from mainSite import databaseManager
from django.core.management import call_command

call_command('makemigrations', interactive = False)
call_command('migrate', interactive = False)

# call_command('syncdb', interactive = False)

userList = [{'username':'******', 'department':'cse', 'name':'Ayush', 'course':'btech', 'hostel' : 'Siang'},
		 {'username':'******', 'department':'cse', 'name':'sdg', 'course':'btech', 'hostel' : 'Kameng'},
		 {'username':'******', 'department':'ece', 'name':'Nice Name', 'course':'mtech', 'hostel' : 'Subuansiri'},
		 {'username':'******', 'department':'des', 'name':'Hiyaa', 'course':'phd', 'hostel' : 'Siang'}
		]

passy = databaseManager.registerUsers(userList)

databaseManager.makeCandidate('adgfd','[{"id": "field0", "type": "text", "value": "Ad Fg Jkl"}, {"id": "field1", "type": "radio", "value": "Male"}, {"id": "field2", "type": "file", "value": "/agendas/not-available.pdf"}]', 'Vice President', '/static/candidates/photos/adgfd.jpg', True)

from mainSite.models import Posts
post = Posts(postname="Vice President", info_fields="[{'description': u'Name', 'type': u'text', 'id': 'field0', 'validation': u'', 'placeholder': u'', 'options': u''}, {'description': u'Gender', 'type': u'radio', 'id': 'field1', 'validation': u'', 'placeholder': u'', 'options': u'Male; Female'}, {'description': u'Agenda', 'type': u'file', 'id': 'field2', 'validation': u'*.pdf', 'placeholder': u'', 'options': u''}]")
post.save()

print passy
databaseManager.registerVote("some text pertaining to a vote", "kayush", passy[0])
databaseManager.registerVote("some text pertaining to a vote", "kayush", passy[0])
databaseManager.registerVote("some text pertaining to a vote", "kayush", passy[0])

#sampe post info_fields
#[{'description': u'Name', 'type': u'text', 'id': 'field0', 'validation': u'', 'placeholder': u'Your Name', 'options': u''}, {'description': u'Date of Birth', 'type': u'text', 'id': 'field1', 'validation': u'[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]', 'placeholder': u'DOB - dd-mm-yyyy', 'options': u''}, {'description': u'Agenda', 'type': u'file', 'id': 'field2', 'validation': u'.*.pdf', 'placeholder': u'', 'options': u''}]
예제 #4
0
파일: tests.py 프로젝트: sowmya05/gems
	def test_votes(self):
		self.assertTrue(databaseManager.registerVote("some text pertaining to a vote", "kayush", self.passy[0]))
예제 #5
0
}, {
    'username': '******',
    'department': 'des',
    'name': 'Hiyaa',
    'course': 'phd',
    'hostel': 'Siang'
}]

passy = databaseManager.registerUsers(userList)

databaseManager.makeCandidate(
    'adgfd',
    '[{"id": "field0", "type": "text", "value": "Ad Fg Jkl"}, {"id": "field1", "type": "radio", "value": "Male"}, {"id": "field2", "type": "file", "value": "/agendas/not-available.pdf"}]',
    'Vice President', '/static/candidates/photos/adgfd.jpg', True)

from mainSite.models import Posts
post = Posts(
    postname="Vice President",
    info_fields=
    "[{'description': u'Name', 'type': u'text', 'id': 'field0', 'validation': u'', 'placeholder': u'', 'options': u''}, {'description': u'Gender', 'type': u'radio', 'id': 'field1', 'validation': u'', 'placeholder': u'', 'options': u'Male; Female'}, {'description': u'Agenda', 'type': u'file', 'id': 'field2', 'validation': u'*.pdf', 'placeholder': u'', 'options': u''}]"
)
post.save()

print passy
databaseManager.registerVote("some text pertaining to a vote", "kayush",
                             passy[0])
databaseManager.registerVote("some text pertaining to a vote", "kayush",
                             passy[0])
databaseManager.registerVote("some text pertaining to a vote", "kayush",
                             passy[0])
예제 #6
0
 def test_votes(self):
     self.assertTrue(
         databaseManager.registerVote("some text pertaining to a vote",
                                      "kayush", self.passy[0]))