def setUp(self): SeleniumTestCase.setUp(self) # Make Q/Web public UserBit.objects.create(verb=GetNode('V/Flags/Public'), qsc=GetNode('Q/Web')) # Make our users self.admin_user, created = ESPUser.objects.get_or_create( username='******', first_name='Harry', last_name='Alborez') self.admin_user.set_password(self.PASSWORD_STRING) make_user_admin(self.admin_user) self.qsd_user, created = ESPUser.objects.get_or_create( username='******', first_name='Aylik', last_name='Kewesd') self.qsd_user.set_password(self.PASSWORD_STRING) self.qsd_user.userbit_set.add( UserBit(verb=GetNode('V/Administer/Edit'), qsc=GetNode('Q'), recursive=True)) self.qsd_user.save() # Check that a NavBarCategory exists if len(NavBarCategory.objects.all()) < 1: nbc = NavBarCategory() nbc.name = 'default' nbc.save() # Make our test page qsd_rec_new = QuasiStaticData() qsd_rec_new.path = GetNode('Q/Web') qsd_rec_new.name = 'test' qsd_rec_new.author = self.admin_user qsd_rec_new.nav_category = NavBarCategory.default() qsd_rec_new.content = '' qsd_rec_new.title = 'Test page' qsd_rec_new.description = '' qsd_rec_new.keywords = '' qsd_rec_new.save() # Set the port that the webdriver will try to access self.driver.testserver_port = settings.VARNISH_PORT # Add the varnish_purge tag Tag.objects.get_or_create(key='varnish_purge', value='true') # Set up the correct site site = Site.objects.get_current() site.domain = settings.VARNISH_HOST + ":" + str(settings.VARNISH_PORT) site.save()
def setUp(self): SeleniumTestCase.setUp(self) # Make our users self.admin_user, created = ESPUser.objects.get_or_create( username='******', first_name='Harry', last_name='Alborez') self.admin_user.set_password(self.PASSWORD_STRING) self.admin_user.makeAdmin() self.qsd_user, created = ESPUser.objects.get_or_create( username='******', first_name='Aylik', last_name='Kewesd') self.qsd_user.set_password(self.PASSWORD_STRING) self.qsd_user.save() # Check that a NavBarCategory exists if len(NavBarCategory.objects.all()) < 1: nbc = NavBarCategory() nbc.name = 'default' nbc.save() # Make our test page qsd_rec_new = QuasiStaticData() qsd_rec_new.url = 'test' qsd_rec_new.name = 'test' qsd_rec_new.author = self.admin_user qsd_rec_new.nav_category = default_navbarcategory() qsd_rec_new.content = '' qsd_rec_new.title = 'Test page' qsd_rec_new.description = '' qsd_rec_new.keywords = '' qsd_rec_new.save() # Set the port that the webdriver will try to access self._old_port = self.driver.testserver_port self.driver.testserver_port = settings.VARNISH_PORT # Add the varnish_purge tag Tag.objects.get_or_create(key='varnish_purge', value='true') # Set up the correct site site = Site.objects.get_current() site.domain = settings.VARNISH_HOST + ":" + str(settings.VARNISH_PORT) site.save()
def setUp(self): SeleniumTestCase.setUp(self) # Make our users self.admin_user, created = ESPUser.objects.get_or_create(username='******', first_name='Harry', last_name='Alborez') self.admin_user.set_password(self.PASSWORD_STRING) self.admin_user.makeAdmin() self.qsd_user, created = ESPUser.objects.get_or_create(username='******', first_name='Aylik', last_name='Kewesd') self.qsd_user.set_password(self.PASSWORD_STRING) self.qsd_user.save() # Check that a NavBarCategory exists if len(NavBarCategory.objects.all()) < 1: nbc = NavBarCategory() nbc.name = 'default' nbc.save() # Make our test page qsd_rec_new = QuasiStaticData() qsd_rec_new.url = 'test' qsd_rec_new.name = 'test' qsd_rec_new.author = self.admin_user qsd_rec_new.nav_category = default_navbarcategory() qsd_rec_new.content = '' qsd_rec_new.title = 'Test page' qsd_rec_new.description = '' qsd_rec_new.keywords = '' qsd_rec_new.save() # Set the port that the webdriver will try to access self._old_port = self.driver.testserver_port self.driver.testserver_port = settings.VARNISH_PORT # Add the varnish_purge tag Tag.objects.get_or_create(key='varnish_purge', value='true') # Set up the correct site site = Site.objects.get_current() site.domain = settings.VARNISH_HOST+":"+str(settings.VARNISH_PORT) site.save()