forked from harrisony/slug
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git+ssh://github.com/sydney-linux-user-group…
…/slug
- Loading branch information
Showing
6 changed files
with
109 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python | ||
"""Tests around creating, publishing, and announcing meetings. | ||
Does not use selenium, so cannot test client behaviour.""" | ||
|
||
import datetime | ||
import random | ||
|
||
import django.test | ||
|
||
import usergroup.event_edit | ||
|
||
#TestCases have lots of public methods | ||
#pylint: disable=R0904 | ||
|
||
class TestTalkOfferLogin(django.test.TestCase): | ||
"""Before we test anything else, let's see if login actually works""" | ||
fixtures = ['test_admin_user', 'test_existing_user'] | ||
|
||
def test_offer_page(self): | ||
"""Ensure that the offer page loads.""" | ||
self.client.login(username='existing', password='password') | ||
offer_page = self.client.get("/offer/add") | ||
self.assertContains(offer_page, 'input name="consent"') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/python | ||
# | ||
# -*- coding: utf-8 -*- | ||
# vim: set ts=4 sw=4 et sts=4 ai: | ||
|
||
"""Uses webdriver to test the login work flow. | ||
Steps are: | ||
* A new user can sign up for the website. | ||
* Can sign up for an event. | ||
* Can cancel their sign up. | ||
""" | ||
|
||
import re | ||
|
||
from selenium import webdriver | ||
from selenium.common.exceptions import NoSuchElementException | ||
from selenium.webdriver.support.ui import WebDriverWait | ||
from selenium.webdriver.common.keys import Keys | ||
import time | ||
|
||
from django.core import mail | ||
from django.utils import unittest | ||
from django import test as djangotest | ||
|
||
from base import SeleniumTestCase | ||
|
||
|
||
class TestAnonymousUserClicksOffer(SeleniumTestCase): | ||
|
||
def test_anonymous_user_clicks_offer_talk(self): | ||
self.assertEqual(1, len(self.browser.window_handles)) | ||
offer_link = self.browser.find_element_by_id('offer') | ||
self.assertEqual(1, len(self.browser.window_handles)) | ||
|
||
class TestLoggedInUserClicksOffer(SeleniumTestCase): | ||
|
||
fixtures = [ 'test_admin_user', 'test_existing_user' ] | ||
|
||
def test_logged_in_user_clicks_offer_talk(self): | ||
"""Check that talk offer page opens in new window""" | ||
self.doLogin(username="existing", password="password") | ||
self.assertEqual(1, len(self.browser.window_handles)) | ||
offer_link = self.browser.find_element_by_id('offer') | ||
self.assertEqual(1, len(self.browser.window_handles)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters