Commits

Vladimyr Pavlenko committed a3b142f

04.11 evening break

  • Participants
  • Parent commits feb046c

Comments (0)

Files changed (3)

-.idea/*
+.idea/*
+*.py[co]

File mysite/fts/tests.py

-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
+from django.test import LiveServerTestCase
+from selenium import webdriver
 
-Replace this with more appropriate tests for your application.
-"""
+class PollsTest(LiveServerTestCase):
 
-from django.test import TestCase
+    def setUp(self):
+        self.browser = webdriver.Firefox()
+        self.browser.implicitly_wait(3)
 
+    def tearDown(self):
+        self.browser.quit()
 
-class SimpleTest(TestCase):
-    def test_basic_addition(self):
-        """
-        Tests that 1 + 1 always equals 2.
-        """
-        self.assertEqual(1 + 1, 2)
+    def test_can_create_new_poll_via_admin_site(self):
+        # Masha opens her browser and goes to the admin page
+        self.browser.get(self.live_server_url + '/admin/')
+
+        # She see "Django administration" on the heading
+        body = self.browser.find_element_by_tag_name('body')
+        self.assertIn('Django administration', body.text)
+
+        # TODO: use the admin site to create a Poll
+        self.fail('finish this test')

File mysite/mysite/settings.py

 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': '',                      # Or path to database file if using sqlite3.
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'database.sqlite',                      # Or path to database file if using sqlite3.
         'USER': '',                      # Not used with sqlite3.
         'PASSWORD': '',                  # Not used with sqlite3.
         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
     # 'django.contrib.admin',
     # Uncomment the next line to enable admin documentation:
     # 'django.contrib.admindocs',
+    "fts"
 )
 
 # A sample logging configuration. The only tangible logging