class UploadTest(ComicframeworkTestCase):
def setUp(self):
Create some objects to work with, In part this is done through
admin views, meaning admin views are also tested here.
// Create four types of users that exist: Root, can do anything,
// projectadmin, cam do things to a project he or she owns. Participant can
// show some restricted content for a project and upload files,
// signup_user can see some pages but not others.
self.root = User.objects.create_user("root",
"w.s.kerkstra@gmail.com",
"testpassword")
self.root.is_staff = True
self.root.is_superuser = True
self.root.save()
// non-root users are created as if they signed up through the project,
// to maximize test coverage.
// Creator of a project.
self.projectadmin = self._create_random_user()
// The project created by projectadmin
self.testproject = create_comicsite_in_admin(self.projectadmin,"testproject")
create_page_in_admin(self.testproject,"testpage1")
// user which has pressed the register link for the project, so is
// part of testproject_participants group
self.participant = self._create_random_user()
self._test_register(self.participant,self.testproject)
// user which has only registered at comicframework but has not
// registered for any project