Commit 8afb41ab authored by cj0125's avatar cj0125

Added a functional test to home page. Added a functional test, view, url, and...

Added a functional test to home page. Added a functional test, view, url, and template to ingredients_create_form. Changed directories of some files.
parent 4e4be49f
".gitattributes"
"db.splite3"
"geckodriver.log"
"/__pycache__/"
File added
<html>
<head>
<title>Ingredients - Create Form</title>
</head>
</html>
\ No newline at end of file
"""thegoodplace URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import IngredientsCreateFormView
urlpatterns = [
url(r'^ingredients_create_form$',IngredientsCreateFormView.as_view(),name='ICF'),
]
from django.shortcuts import render
# Create your views here.
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import UpdateView, CreateView
class IngredientsCreateFormView(CreateView):
model = None
template_name = 'ingredients_create_form.html'
import unittest
from selenium import webdriver
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_open_froyo(self):
self.browser.get('http://localhost:8000')
self.assertIn('The Good Place FroYo Shop', self.browser.title)
def test_display_ICF(self):
self.browser.get('http://localhost:8000/ingredients_create_form')
self.assertIn('Ingredients - Create Form', self.browser.title)
self.assertIn('http://localhost:8000/ingredients_create_form', self.browser.current_url)
self.fail('Finish the test!')
if __name__ == '__main__':
unittest.main(warnings = 'ignore')
1584695320711 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\ANTHON~1\\AppData\\Local\\Temp\\rust_mozprofilev369C1"
1584695328271 addons.webextension.doh-rollout@mozilla.org WARN Loading extension 'doh-rollout@mozilla.org': Reading manifest: Invalid extension permission: networkStatus
1584695330578 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1584695330578 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1584695330579 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1584695330579 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
1584695370146 Marionette INFO Listening on port 56047
1584695370580 Marionette WARN TLS certificate errors will be ignored for this session
1584695374263 Marionette INFO Stopped listening on port 56047
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
1584695385461 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\ANTHON~1\\AppData\\Local\\Temp\\rust_mozprofilefC2iqs"
1584695387612 addons.webextension.doh-rollout@mozilla.org WARN Loading extension 'doh-rollout@mozilla.org': Reading manifest: Invalid extension permission: networkStatus
1584695389648 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1584695389648 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1584695389649 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1584695389649 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
1584695396809 Marionette INFO Listening on port 56119
1584695397015 Marionette WARN TLS certificate errors will be ignored for this session
1584695400328 Marionette INFO Stopped listening on port 56119
JavaScript error: resource://activity-stream/lib/ActivityStreamPrefs.jsm, line 27: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.removeObserver]
JavaScript error: resource://gre/modules/Sqlite.jsm, line 912: Error: Connection is not open.
JavaScript error: resource://gre/modules/NewTabUtils.jsm, line 669: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsINavHistoryService.asyncExecuteLegacyQuery]
###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
......@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('froyo.urls')),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment