Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jean Michel Rouly
bookshare
Commits
b81c9733
Commit
b81c9733
authored
May 01, 2015
by
Daniel W Bond
Browse files
beginning of test cases for core app
parent
430bbb67
Changes
1
Hide whitespace changes
Inline
Side-by-side
bookshare/core/tests.py
View file @
b81c9733
from
django.test
import
TestCase
from
django.http
import
HttpRequest
from
django.core.urlresolvers
import
resolve
from
.models
import
Student
from
.views
import
DetailStudent
,
StudentRatings
class
ProfileTest
(
TestCase
):
def
test_username_resolves_to_profile
(
self
):
found
=
resolve
(
'/student/username/'
)
self
.
assertEqual
(
found
.
func
,
home_page
)
request
=
HttpResponse
()
reponse
=
profile
(
request
)
self
.
assertTrue
(
response
.
content
.
startswith
(
'<html>'
))
self
.
assertIn
(
'<title>user.get_full_name</title>'
,
response
.
content
)
self
.
assertTrue
(
response
.
content
.
endswith
(
'</html>'
))
# Create your tests here.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment