Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Milleville
SCODOC_R6A06
Commits
46cdaf75
Commit
46cdaf75
authored
1 year ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
Fix unit tests
parent
d1d89cc4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/models/modules.py
+1
-1
1 addition, 1 deletion
app/models/modules.py
scodoc.py
+1
-0
1 addition, 0 deletions
scodoc.py
tests/conftest.py
+9
-3
9 additions, 3 deletions
tests/conftest.py
with
11 additions
and
4 deletions
app/models/modules.py
+
1
−
1
View file @
46cdaf75
...
...
@@ -116,7 +116,7 @@ class Module(models.ScoDocModel):
def
create_from_dict
(
cls
,
data
:
dict
)
->
"
Module
"
:
"""
Create from given dict, add parcours
"""
mod
=
super
().
create_from_dict
(
data
)
for
p
in
data
[
"
parcours
"
]:
for
p
in
data
.
get
(
"
parcours
"
,
[])
or
[
]:
if
isinstance
(
p
,
ApcParcours
):
parcour
:
ApcParcours
=
p
else
:
...
...
This diff is collapsed.
Click to expand it.
scodoc.py
+
1
−
0
View file @
46cdaf75
...
...
@@ -59,6 +59,7 @@ cli.register(app)
@app.context_processor
def
inject_sco_utils
():
"
Make scu available in all Jinja templates
"
# if modified, put the same in conftest.py#27
return
dict
(
scu
=
scu
)
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
9
−
3
View file @
46cdaf75
import
pytest
from
flask
import
g
from
flask_login
import
login_user
,
logout_user
,
current_user
from
flask_login
import
login_user
from
config
import
TestConfig
import
app
from
app
import
db
,
create_app
from
app
import
initialize_scodoc_database
,
clear_scodoc_cache
from
app
import
models
from
app.auth.models
import
User
,
Role
,
UserRole
,
Permission
from
app.auth.models
import
User
,
Role
from
app.auth.models
import
get_super_admin
from
app.scodoc
import
sco_bulletins_standard
from
app.scodoc
import
notesdb
as
ndb
import
app.scodoc.sco_utils
as
scu
RESOURCES_DIR
=
"
/opt/scodoc/tests/ressources
"
...
...
@@ -23,6 +23,12 @@ def test_client():
# Run tests:
with
apptest
.
test_client
()
as
client
:
with
apptest
.
app_context
():
@apptest.context_processor
def
inject_sco_utils
():
"
Make scu available in all Jinja templates
"
return
dict
(
scu
=
scu
)
with
apptest
.
test_request_context
():
# initialize scodoc "g":
g
.
stored_get_formsemestre
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment