Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
W
website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
84
Issues
84
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Video AG Infrastruktur
website
Commits
b7f2674b
Commit
b7f2674b
authored
Dec 02, 2017
by
Andreas Valder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a test for adding a new course
parent
d7db07d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
tests.py
tests.py
+13
-4
No files found.
tests.py
View file @
b7f2674b
...
...
@@ -8,15 +8,12 @@ import flask
from
flask
import
url_for
class
VideoTestCase
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
server
.
app
.
testing
=
True
@
classmethod
def
tearDownClass
(
cls
):
os
.
unlink
(
server
.
app
.
config
[
'SQLITE_DB'
])
def
setUp
(
self
):
server
.
app
.
testing
=
True
self
.
app
=
server
.
app
.
test_client
()
def
test_index
(
self
):
...
...
@@ -61,6 +58,18 @@ class VideoTestCase(unittest.TestCase):
assert
r
.
status_code
==
302
assert
'<a href="/">'
in
r
.
data
.
decode
()
def
test_edit
(
self
):
with
self
.
app
as
c
:
with
c
.
session_transaction
()
as
sess
:
sess
[
'user'
]
=
{
'name'
:
'videoag'
,
'_csrf_token'
:
'asd'
,
'dbid'
:
72
}
sess
[
'_csrf_token'
]
=
'asd'
# add course
r
=
c
.
get
(
'/internal/new/courses'
,
data
=
{
'title'
:
'Neue Veranstaltung totalyrandomcrap'
,
'responsible'
:
'foo'
,
'handle'
:
'2r5sQDFCRT3DG'
,
'_csrf_token'
:
'asd'
})
assert
r
.
status_code
==
200
r
=
self
.
app
.
get
(
'/courses'
)
assert
r
.
status_code
==
200
assert
'Neue Veranstaltung totalyrandomcrap'
in
r
.
data
.
decode
()
and
'2r5sQDFCRT3DG'
in
r
.
data
.
decode
()
def
test_legacyurl
(
self
):
with
self
.
app
as
c
:
r
=
self
.
app
.
get
(
'/site/feed.php?newcourses'
)
...
...
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