Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
AURA
steering
Commits
21d7fa26
Verified
Commit
21d7fa26
authored
8 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
test: remove tests for creating & deleting notes
parent
e0040cf4
No related branches found
No related tags found
No related merge requests found
Pipeline
#8357
passed
8 months ago
Stage: check
Stage: test
Stage: build
Stage: deploy
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/tests/test_notes.py
+1
-50
1 addition, 50 deletions
program/tests/test_notes.py
with
1 addition
and
50 deletions
program/tests/test_notes.py
+
1
−
50
View file @
21d7fa26
import
pytest
import
pytest
from
conftest
import
assert_data
from
conftest
import
assert_data
from
program.models
import
LinkType
,
Note
,
TimeSlot
from
program.models
import
LinkType
,
TimeSlot
from
program.tests.factories
import
NoteFactory
from
program.tests.factories
import
NoteFactory
pytestmark
=
pytest
.
mark
.
django_db
pytestmark
=
pytest
.
mark
.
django_db
...
@@ -37,39 +37,6 @@ def test_read_notes_as_unauthenticated_user(api_client):
...
@@ -37,39 +37,6 @@ def test_read_notes_as_unauthenticated_user(api_client):
assert
len
(
response
.
data
)
==
NOTES
assert
len
(
response
.
data
)
==
NOTES
@pytest.mark.django_db
(
transaction
=
True
)
def
test_create_note_for_owned_show_fails_if_it_exists
(
user_with_note_perms
,
api_client_note_perms
,
owned_show_once_timeslot_perms
):
data
=
note_data
(
timeslot
=
owned_show_once_timeslot_perms
)
response
=
api_client_note_perms
.
post
(
url
(),
data
=
data
)
assert
response
.
status_code
==
400
def
test_create_note_for_owned_show
(
user_with_note_perms
,
api_client_note_perms
,
owned_show_once_timeslot_perms
):
Note
.
objects
.
get
(
pk
=
owned_show_once_timeslot_perms
.
note
.
id
).
delete
()
data
=
note_data
(
timeslot
=
owned_show_once_timeslot_perms
)
response
=
api_client_note_perms
.
post
(
url
(),
data
=
data
)
assert
response
.
status_code
==
201
def
test_create_note_not_found_for_not_owned_show
(
user_with_note_perms
,
api_client_note_perms
,
show_once_timeslot
):
data
=
note_data
(
timeslot
=
show_once_timeslot
)
response
=
api_client_note_perms
.
patch
(
url
(
note
=
show_once_timeslot
.
note
),
data
=
data
)
assert
response
.
status_code
==
404
def
test_update_note_for_owned_show
(
def
test_update_note_for_owned_show
(
user_with_note_perms
,
api_client_note_perms
,
owned_show_once_timeslot_perms
user_with_note_perms
,
api_client_note_perms
,
owned_show_once_timeslot_perms
):
):
...
@@ -109,19 +76,3 @@ def test_update_note_links(
...
@@ -109,19 +76,3 @@ def test_update_note_links(
assert
response
.
status_code
==
200
assert
response
.
status_code
==
200
assert_data
(
response
,
update
)
assert_data
(
response
,
update
)
def
test_delete_note_for_owned_show
(
user_with_note_perms
,
api_client_note_perms
,
owned_show_once_timeslot_perms
):
response
=
api_client_note_perms
.
delete
(
url
(
note
=
owned_show_once_timeslot_perms
.
note
))
assert
response
.
status_code
==
204
def
test_delete_note_not_found_for_not_owned_show
(
user_with_note_perms
,
api_client_note_perms
,
once_timeslot
):
response
=
api_client_note_perms
.
delete
(
url
(
note
=
once_timeslot
.
note
))
assert
response
.
status_code
==
404
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