def setUp(self): self.user = self.create_user(username='******') settings = SiteSettings.objects.get_current() settings.admins.add(self.user) BaseTestCase.setUp(self) self.create_video(status=Video.UNAPPROVED) self.create_video(status=Video.UNAPPROVED) self.create_video(status=Video.UNAPPROVED) patcher = mock.patch('mirocommunity_saas.admin.approve_reject_views.' '_approve_all') self.approve_all = patcher.start() self.addCleanup(patcher.stop)
def setUp(self): BaseTestCase.setUp(self) site_settings = SiteSettings.objects.get_current() self.user = self.create_user(username='******', is_active=True) self.admin = self.create_user(username='******', is_active=True) self.old_admin = self.create_user(username='******', is_active=False) self.superuser = self.create_user(username='******', is_active=True, is_superuser=True) self.old_superuser = self.create_user(username='******', is_active=False, is_superuser=True) site_settings.admins.add(self.admin) site_settings.admins.add(self.old_admin) site_settings.admins.add(self.superuser) site_settings.admins.add(self.old_superuser)
def setUp(self): BaseTestCase.setUp(self) for i in range(3): self.create_video(status=Video.UNAPPROVED, name='video{0}'.format(i), file_url='http://google.com/{0}'.format(i)) self.prefix = 'pfx' default = { '{0}-{1}'.format(self.prefix, TOTAL_FORM_COUNT): 4, '{0}-{1}'.format(self.prefix, INITIAL_FORM_COUNT): 3 } qs = Video.objects.all() for i, v in enumerate(list(qs) + [Video()]): default.update(dict(('{0}-{1}-{2}'.format(self.prefix, i, k), v) for k, v in model_to_dict(v).iteritems())) default['{0}-{1}-{2}'.format(self.prefix, i, 'BULK')] = True self.approve_data = {'bulk_action': 'feature'} self.feature_data = {'bulk_action': 'approve'} self.approve_data.update(default) self.feature_data.update(default)
def setUp(self): BaseTestCase.setUp(self) for i in range(3): self.create_video(status=Video.UNAPPROVED, name='video{0}'.format(i), file_url='http://google.com/{0}'.format(i)) self.prefix = 'pfx' default = { '{0}-{1}'.format(self.prefix, TOTAL_FORM_COUNT): 4, '{0}-{1}'.format(self.prefix, INITIAL_FORM_COUNT): 3 } qs = Video.objects.all() for i, v in enumerate(list(qs) + [Video()]): default.update( dict(('{0}-{1}-{2}'.format(self.prefix, i, k), v) for k, v in model_to_dict(v).iteritems())) default['{0}-{1}-{2}'.format(self.prefix, i, 'BULK')] = True self.approve_data = {'bulk_action': 'feature'} self.feature_data = {'bulk_action': 'approve'} self.approve_data.update(default) self.feature_data.update(default)
def setUp(self): self.create_user(email='superuser@localhost', is_superuser=True) BaseTestCase.setUp(self)
def setUp(self): BaseTestCase.setUp(self) self.user = self.create_user(username='******') settings = SiteSettings.objects.get_current() settings.admins.add(self.user)
def setUp(self): BaseTestCase.setUp(self) self.mock = mock.MagicMock(__name__='function') self.view = _video_limit_wrapper(self.mock)