def testLogin(self): """Test logging in the user to the system.""" username = "******" password = "******" test_utils.setup_user(username, password) challenge_mgr.register_page_widget("home", "home") self.login(username, password) self.selenium.get('%s%s' % (self.live_server_url, "/home/")) try: self.assertEqual("Kukui Cup: Home", self.selenium.title) except AssertionError, e: print e
def testLogin(self): """Test logging in the user to the system.""" username = "******" password = "******" test_utils.setup_user(username, password) challenge_mgr.register_page_widget("home", "home") self.login(username, password) self.selenium.get('%s%s' % (self.live_server_url, "/home/")) try: self.assertEqual("Kukui Cup: Home", self.selenium.title) except AssertionError, e: print e
def setUp(self): """Sets up the test environment.""" self.user = test_utils.setup_user("user", "changeme") self.draft = Draft(name="test", slug="test") test_utils.set_competition_round() self.team = self.user.profile.team self.predicates = [ "completed_action('intro-video')", "submitted_all_of_type(action_type='commitment')", "allocated_raffle_ticket()", "badge_awarded('daily-visitor')", "completed_some_of_level(level_priority=1, count=2)", "submitted_some_of_resource(resource='energy', count=2)", "submitted_all_of_level(1)", "approved_all_of_resource(resource='energy')", "approved_some_of_resource(resource='water', count=3)", "set_profile_pic()", "referring_count(4)", "daily_visit_count(10)", "unlock_on_date('13-07-16')", "unlock_on_event(event_slug='kick-off', days=-3, lock_after_days=5)", "approved_some_of_level(level_priority=3, count=3)", "submitted_level(3)", "completed_some_of('event', 3)", "daily_energy_goal_count(5)", "submitted_action('like-cup')", "approved_all_of_type('commitment')", "approved_all_of_level(4)", "posted_to_wall()", "submitted_some_of_level(3, 4)", "submitted_some_of_type('commitment', 2)", "submitted_some_full_spectrum(3)", "change_theme()", "changed_theme()", "approved_some_full_spectrum(4)", "reached_round('Round 2')", "social_bonus_count(30)", "team_member_point_percent(30, 25)", "approved_some(5)", "completed_level(3)", "approved_action('like-cup')", "has_points(10)", "submitted_all_of_resource('water')", "submitted_some(34)", "game_enabled('foobar')", "is_admin()", "approved_some_of_type('activity', 5)" ]
def setUp(self): """setup""" self.user = self.user = test_utils.setup_user(username="******", password="******") challenge_mgr.register_page_widget("learn", "smartgrid") self.client.login(username="******", password="******")
def setUp(self): self.user = test_utils.setup_user(username="******", password="******") challenge_mgr.register_page_widget("help", "help.rule") cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """Set up a team and log in.""" # challenge_mgr.init() test_utils.set_competition_round() self.user = test_utils.setup_user(username="******", password="******") test_utils.setup_round_prize("Round 1", "team_overall", "energy") test_utils.setup_round_prize("Round 2", "team_overall", "energy") test_utils.setup_round_prize("Round 1", "team_overall", "points") test_utils.setup_round_prize("Round 2", "team_overall", "points") test_utils.setup_round_prize("Round 1", "individual_overall", "points") test_utils.setup_round_prize("Round 2", "individual_overall", "points") test_utils.setup_round_prize("Round 1", "individual_team", "points") test_utils.setup_round_prize("Round 2", "individual_team", "points") print "setUp prize count %d" % Prize.objects.count() challenge_mgr.register_page_widget("win", "prizes") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() profile = self.user.get_profile() profile.add_points(10, datetime.datetime.today(), "test") profile.save() self.client.login(username="******", password="******")
def setUp(self): """Initialize a user and log them in.""" self.user = test_utils.setup_user(username="******", password="******") self.team = self.user.get_profile().team test_utils.set_competition_round() challenge_mgr.register_page_widget("energy", "resource_scoreboard.energy") self.client.login(username="******", password="******")
def setUp(self): """setup""" self.user = test_utils.setup_user(username="******", password="******") test_utils.set_competition_round() challenge_mgr.register_page_widget("profile", "my_info") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """setup""" self.user = test_utils.setup_user(username="******", password="******") test_utils.set_competition_round() challenge_mgr.register_page_widget("profile", "my_info") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """setup""" self.user = self.user = test_utils.setup_user(username="******", password="******") challenge_mgr.register_page_widget("learn", "smartgrid") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def testPages(self): """Test accessing all the pages in the system.""" username = "******" password = "******" test_utils.setup_user(username, password) challenge_mgr.register_page_widget("home", "home") challenge_mgr.register_page_widget("learn", "home") challenge_mgr.register_page_widget("energy", "home") challenge_mgr.register_page_widget("water", "home") challenge_mgr.register_page_widget("news", "home") challenge_mgr.register_page_widget("profile", "home") challenge_mgr.register_page_widget("help", "home") challenge_mgr.register_page_widget("win", "win") challenge_mgr.register_page_widget("status", "status") challenge_mgr.register_page_widget("about", "about") self.login(username, password) try: self.selenium.get('%s%s' % (self.live_server_url, "/home/")) self.assertEqual("Kukui Cup: Home", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/learn/")) self.assertEqual("Kukui Cup: Learn", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/energy/")) self.assertEqual("Kukui Cup: Energy", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/water/")) self.assertEqual("Kukui Cup: Water", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/news/")) self.assertEqual("Kukui Cup: News", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/win/")) self.assertEqual("Kukui Cup: Win", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/profile/")) self.assertEqual("Kukui Cup: Profile", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/help/")) self.assertEqual("Kukui Cup: Help", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/status/")) self.assertEqual("Kukui Cup: Status", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/about/")) self.assertEqual("Kukui Cup: Welcome to KukuiCup!", self.selenium.title) except AssertionError, e: print e
def testPages(self): """Test accessing all the pages in the system.""" username = "******" password = "******" test_utils.setup_user(username, password) challenge_mgr.register_page_widget("home", "home") challenge_mgr.register_page_widget("learn", "home") challenge_mgr.register_page_widget("energy", "home") challenge_mgr.register_page_widget("water", "home") challenge_mgr.register_page_widget("news", "home") challenge_mgr.register_page_widget("profile", "home") challenge_mgr.register_page_widget("help", "home") challenge_mgr.register_page_widget("win", "win") challenge_mgr.register_page_widget("status", "status") challenge_mgr.register_page_widget("about", "about") self.login(username, password) try: self.selenium.get('%s%s' % (self.live_server_url, "/home/")) self.assertEqual("Kukui Cup: Home", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/learn/")) self.assertEqual("Kukui Cup: Learn", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/energy/")) self.assertEqual("Kukui Cup: Energy", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/water/")) self.assertEqual("Kukui Cup: Water", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/news/")) self.assertEqual("Kukui Cup: News", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/win/")) self.assertEqual("Kukui Cup: Win", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/profile/")) self.assertEqual("Kukui Cup: Profile", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/help/")) self.assertEqual("Kukui Cup: Help", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/status/")) self.assertEqual("Kukui Cup: Status", self.selenium.title) self.selenium.get('%s%s' % (self.live_server_url, "/about/")) self.assertEqual("Kukui Cup: Welcome to KukuiCup!", self.selenium.title) except AssertionError, e: print e
def setUp(self): """Set up rounds, team, and a user.""" # Set up rounds. test_utils.set_three_rounds() # Set up user self.user = test_utils.setup_user(username="******", password="******") challenge_mgr.register_page_widget("win", "raffle") self.client.login(username="******", password="******")
def setUp(self): self.user = test_utils.setup_user(username="******", password="******") self.team = self.user.get_profile().team challenge_mgr.register_page_widget("help", "help.faq") challenge_mgr.register_page_widget("home", "home") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """ setup """ challenge_mgr.init() self.user = test_utils.setup_user(username="******", password="******") test_utils.set_competition_round() challenge_mgr.register_page_widget("learn", "participation") cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """Set up rounds, team, and a user.""" # Set up rounds. test_utils.set_two_rounds() # Set up user self.user = test_utils.setup_user(username="******", password="******") challenge_mgr.register_page_widget("win", "raffle") self.client.login(username="******", password="******")
def setUp(self): """ setup """ challenge_mgr.init() self.user = test_utils.setup_user(username="******", password="******") test_utils.set_competition_round() challenge_mgr.register_page_widget("learn", "participation") cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """setup""" self.user = self.user = test_utils.setup_user(username="******", password="******") challenge_mgr.register_page_widget("learn", "smartgrid") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): self.user = test_utils.setup_user(username="******", password="******") self.team = self.user.get_profile().team challenge_mgr.register_page_widget("help", "help.faq") challenge_mgr.register_page_widget("home", "home") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """Initialize a user and log them in.""" self.user = test_utils.setup_user(username="******", password="******") self.team = self.user.profile.team test_utils.set_competition_round() challenge_mgr.register_page_widget("energy", "resource_scoreboard.energy") game, _ = GameInfo.objects.get_or_create(name="Energy Game") game.enabled = True game.save() self.client.login(username="******", password="******")
def setUp(self): """Sets up the environment for running the tests.""" self.user = test_utils.setup_user(username="******", password="******") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******") test_utils.set_competition_round() self.activity = test_utils.create_activity(slug=None, unlock_condition=None) self.activity.save() self.commitment = test_utils.create_commitment(slug=None, unlock_condition=None) self.commitment.save() self.event = test_utils.create_event(slug=None, unlock_condition=None) self.event.save()
def setUp(self): self.user = test_utils.setup_user(username="******", password="******") self.team = self.user.profile.team challenge_mgr.register_page_widget("news", "popular_tasks") challenge_mgr.register_page_widget("news", "my_commitments") challenge_mgr.register_page_widget("news", "wallpost.system_wallpost") challenge_mgr.register_page_widget("news", "wallpost.user_wallpost") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): self.user = test_utils.setup_user(username="******", password="******") self.team = self.user.get_profile().team challenge_mgr.register_page_widget("news", "popular_tasks") challenge_mgr.register_page_widget("news", "my_commitments") challenge_mgr.register_page_widget("news", "wallpost.system_wallpost") challenge_mgr.register_page_widget("news", "wallpost.user_wallpost") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******")
def setUp(self): """Initialize a user and log them in.""" self.user = test_utils.setup_user(username="******", password="******") self.team = self.user.get_profile().team test_utils.set_competition_round() challenge_mgr.register_page_widget("energy", "resource_scoreboard.energy") game, _ = GameInfo.objects.get_or_create(name="Energy Game") game.enabled = True game.save() self.client.login(username="******", password="******")
def setUp(self): """Sets up the test environment.""" self.user = test_utils.setup_user("user", "changeme") self.draft = Draft(name="test", slug="test") test_utils.set_competition_round() self.team = self.user.profile.team self.predicates = [ "completed_action('intro-video')", "submitted_all_of_type(action_type='commitment')", "allocated_raffle_ticket()", "badge_awarded('daily-visitor')", "completed_some_of_level(level_priority=1, count=2)", "submitted_some_of_resource(resource='energy', count=2)", "submitted_all_of_level(1)", "approved_all_of_resource(resource='energy')", "approved_some_of_resource(resource='water', count=3)", "set_profile_pic()", "referring_count(4)", "daily_visit_count(10)", "unlock_on_date('13-07-16')", "unlock_on_event(event_slug='kick-off', days=-3, lock_after_days=5)", "approved_some_of_level(level_priority=3, count=3)", "submitted_level(3)", "completed_some_of('event', 3)", "daily_energy_goal_count(5)", "submitted_action('like-cup')", "approved_all_of_type('commitment')", "approved_all_of_level(4)", "posted_to_wall()", "submitted_some_of_level(3, 4)", "submitted_some_of_type('commitment', 2)", "submitted_some_full_spectrum(3)", "change_theme()", "changed_theme()", "approved_some_full_spectrum(4)", "reached_round('Round 2')", "social_bonus_count(30)", "team_member_point_percent(30, 25)", "approved_some(5)", "completed_level(3)", "approved_action('like-cup')", "has_points(10)", "submitted_all_of_resource('water')", "submitted_some(34)", "game_enabled('foobar')", "is_admin()", "approved_some_of_type('activity', 5)", ]
def setUp(self): """Sets up the environment for running the tests.""" self.user = test_utils.setup_user(username="******", password="******") from apps.managers.cache_mgr import cache_mgr cache_mgr.clear() self.client.login(username="******", password="******") test_utils.set_competition_round() self.activity = test_utils.create_activity(slug=None, unlock_condition=None) self.activity.save() self.commitment = test_utils.create_commitment(slug=None, unlock_condition=None) self.commitment.save() self.event = test_utils.create_event(slug=None, unlock_condition=None) self.event.save()
def setUp(self): """Initialize a user and log them in.""" self.user = test_utils.setup_user("user", "changeme") test_utils.set_competition_round() self.team = self.user.profile.team
def setUp(self): """Initialize a user and log them in.""" self.user = test_utils.setup_user("user", "changeme") test_utils.set_competition_round() self.team = self.user.get_profile().team
def setUp(self): """setup""" self.user = test_utils.setup_user(username="******", password="******") self.client.login(username="******", password="******")
def setUp(self): """setup""" self.user = test_utils.setup_user(username="******", password="******") self.client.login(username="******", password="******")