Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIF
AKPlanning
Merge requests
!141
Add view tests
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add view tests
meta-tests
into
main
Overview
0
Commits
11
Pipelines
25
Changes
2
Merged
Benjamin Hättasch
requested to merge
meta-tests
into
main
2 years ago
Overview
0
Commits
11
Pipelines
25
Changes
2
Expand
Introduce framework to simply test correct rendering of views
Create tests for dashboard views
Create tests for plan views
Create tests for default admin views (add and change) of AKModel models
Create tests for scheduling (admin) views
Create tests for submission views
Improve pipeline to correctly run the new tests on a blank database with fixture loading
Add coverage reporting
Show test results in GitLab directly
Edited
2 years ago
by
Benjamin Hättasch
0
0
Merge request reports
Viewing commit
b2715dcb
Prev
Next
Show latest version
2 files
+
4
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
b2715dcb
Fix test method titles (naming convention)
· b2715dcb
Benjamin Hättasch
authored
2 years ago
AKModel/tests.py
+
3
−
3
Options
@@ -38,13 +38,13 @@ class BasicViewTests:
url
=
reverse_lazy
(
view_name_with_prefix
,
kwargs
=
view_name
[
1
])
return
view_name_with_prefix
,
url
def
test
V
iews
F
or200
(
self
):
def
test
_v
iews
_f
or
_
200
(
self
):
for
view_name
in
self
.
VIEWS
:
view_name_with_prefix
,
url
=
self
.
_name_and_url
(
view_name
)
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
200
,
msg
=
f
"
{
view_name_with_prefix
}
(
{
url
}
) broken
"
)
def
test
A
ccess
C
ontrol
S
taff
O
nly
(
self
):
def
test
_a
ccess
_c
ontrol
_s
taff
_o
nly
(
self
):
self
.
client
.
logout
()
for
view_name
in
self
.
VIEWS_STAFF_ONLY
:
view_name_with_prefix
,
url
=
self
.
_name_and_url
(
view_name
)
@@ -76,7 +76,7 @@ class ModelViewTests(BasicViewTests, TestCase):
(
DefaultSlot
,
'
defaultslot
'
)
]
def
test
A
dmin
(
self
):
def
test
_a
dmin
(
self
):
self
.
client
.
force_login
(
self
.
admin_user
)
for
model
in
self
.
ADMIN_MODELS
:
Loading