Background Image
Table of Contents Table of Contents
Previous Page  163 / 478 Next Page
Information
Show Menu
Previous Page 163 / 478 Next Page
Page Background

$

python3 manage.py test functional_tests --liveserver=superlists-staging.ottg.eu

Creating test database for alias 'default'...

FE

======================================================================

FAIL: test_can_start_a_list_and_retrieve_it_later

(functional_tests.tests.NewVisitorTest)

---------------------------------------------------------------------

Traceback (most recent call last):

File "/workspace/superlists/functional_tests/tests.py", line 42, in

test_can_start_a_list_and_retrieve_it_later

self.assertIn('To-Do', self.browser.title)

AssertionError: 'To-Do' not found in 'Domain name registration | Domain names

| Web Hosting | 123-reg'

======================================================================

FAIL: test_layout_and_styling (functional_tests.tests.NewVisitorTest)

---------------------------------------------------------------------

Traceback (most recent call last):

File

"/workspace/superlists/functional_tests/tests.py", line 114, in

test_layout_and_styling

inputbox = self.browser.find_element_by_id('id_new_item')

[...]

selenium.common.exceptions.NoSuchElementException: Message: 'Unable to locate

element: {"method":"id","selector":"id_new_item"}' ; Stacktrace:

---------------------------------------------------------------------

Ran 2 tests in 16.480s

FAILED (failures=2)

Destroying test database for alias 'default'...

You can see that both tests are failing, as expected, since I haven’t actually set up my

staging site yet. In fact, you can see from the first traceback that the test is actually ending

up on the home page of my domain registrar.

The FT seems to be testing the right things though, so let’s commit:

$

git diff

# should show changes to functional_tests.py

$

git commit -am "Hack FT runner to be able to test staging"

Getting a Domain Name

We’re going to need a couple of domain names at this point in the book—they can both

be subdomains of a single domain. I’m going to use

superlists.ottg.eu

and

superlists-

staging.ottg.eu

. If you don’t already own a domain, this is the time to register one! Again,

this is something I really want you to

actually

do. If you’ve never registered a domain

before, just pick any old registrar and buy a cheap one—it should only cost you $5 or

so, and you can even find free ones. I promise seeing your site on a “real” web site will

be a thrill.

Getting a Domain Name

|

135