Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
SMASCH
scheduling-system
Commits
7a692602
Commit
7a692602
authored
4 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
tests should be perfomed in a clear manner
parent
b066e200
No related branches found
No related tags found
1 merge request
!231
Resolve "auto-import of subject data"
Pipeline
#24425
passed
4 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/tests/importer/test_importer.py
+1
-1
1 addition, 1 deletion
smash/web/tests/importer/test_importer.py
smash/web/tests/importer/test_importer_cron_job.py
+9
-3
9 additions, 3 deletions
smash/web/tests/importer/test_importer_cron_job.py
with
10 additions
and
4 deletions
smash/web/tests/importer/test_importer.py
+
1
−
1
View file @
7a692602
...
...
@@ -6,7 +6,7 @@ import logging
from
django.test
import
TestCase
from
mock_reader
import
MockReader
from
tests.functions
import
create_study_subject
from
web.
tests.functions
import
create_study_subject
from
web.importer
import
Importer
from
web.models
import
Subject
,
StudySubject
,
Study
from
web.models.constants
import
GLOBAL_STUDY_ID
...
...
This diff is collapsed.
Click to expand it.
smash/web/tests/importer/test_importer_cron_job.py
+
9
−
3
View file @
7a692602
# coding=utf-8
import
logging
import
tempfile
from
shutil
import
copyfile
from
django.conf
import
settings
from
django.test
import
TestCase
...
...
@@ -15,6 +17,9 @@ from django_cron.models import CronJobLog
class
TestCronJobImporter
(
TestCase
):
def
tearDown
(
self
):
setattr
(
settings
,
"
DAILY_IMPORT_FILE
"
,
None
)
def
test_import_without_configuration
(
self
):
CronJobLog
.
objects
.
all
().
delete
()
...
...
@@ -27,7 +32,10 @@ class TestCronJobImporter(TestCase):
def
test_import
(
self
):
filename
=
get_resource_path
(
'
import.csv
'
)
setattr
(
settings
,
"
DAILY_IMPORT_FILE
"
,
filename
)
new_file
,
tmp
=
tempfile
.
mkstemp
()
copyfile
(
filename
,
tmp
)
setattr
(
settings
,
"
DAILY_IMPORT_FILE
"
,
tmp
)
CronJobLog
.
objects
.
all
().
delete
()
job
=
ImporterCronJob
()
...
...
@@ -36,5 +44,3 @@ class TestCronJobImporter(TestCase):
self
.
assertEqual
(
"
import is successful
"
,
status
)
self
.
assertEqual
(
1
,
len
(
mail
.
outbox
))
setattr
(
settings
,
"
DAILY_IMPORT_FILE
"
,
None
)
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