Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-deposit
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-deposit
Commits
16a8004b
Verified
Commit
16a8004b
authored
7 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
swh.deposit.tests: Badly formatted atom xml results in a bad request
parent
4b9fec58
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/deposit/tests/api/test_deposit_atom.py
+10
-0
10 additions, 0 deletions
swh/deposit/tests/api/test_deposit_atom.py
with
10 additions
and
0 deletions
swh/deposit/tests/api/test_deposit_atom.py
+
10
−
0
View file @
16a8004b
...
@@ -89,6 +89,9 @@ and other stuff</description>
...
@@ -89,6 +89,9 @@ and other stuff</description>
self
.
atom_entry_tei
=
b
"""
<TEI><teiHeader><fileDesc><titleStmt><title>HAL TEI export of hal-01587083</title></titleStmt><publicationStmt><distributor>CCSD</distributor><availability status=
"
restricted
"
><licence target=
"
http://creativecommons.org/licenses/by/4.0/
"
>Distributed under a Creative Commons Attribution 4.0 International License</licence></availability><date when=
"
2017-10-03T17:21:03+02:00
"
/></publicationStmt><sourceDesc><p part=
"
N
"
>HAL API platform</p></sourceDesc></fileDesc></teiHeader><text><body><listBibl><biblFull><titleStmt><title xml:lang=
"
en
"
>questionnaire software metadata</title><author role=
"
aut
"
><persName><forename type=
"
first
"
>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>7de56c632362954fa84172cad80afe4e</email><email type=
"
domain
"
>inria.fr</email><ptr type=
"
url
"
target=
"
moranegg.github.io
"
/><idno type=
"
halauthorid
"
>1556733</idno><affiliation ref=
"
#struct-474639
"
/></author><editor role=
"
depositor
"
><persName><forename>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>f85a43a5fb4a2e0778a77e017f28c8fd</email><email type=
"
domain
"
>gmail.com</email></editor></titleStmt><editionStmt><edition n=
"
v1
"
type=
"
current
"
><date type=
"
whenSubmitted
"
>2017-09-29 11:21:32</date><date type=
"
whenModified
"
>2017-10-03 17:20:13</date><date type=
"
whenReleased
"
>2017-10-03 17:20:13</date><date type=
"
whenProduced
"
>2017-09-29</date><date type=
"
whenEndEmbargoed
"
>2017-09-29</date><ref type=
"
file
"
target=
"
https://hal.inria.fr/hal-01587083/document
"
><date notBefore=
"
2017-09-29
"
/></ref><ref type=
"
file
"
subtype=
"
author
"
n=
"
1
"
target=
"
https://hal.inria.fr/hal-01587083/file/questionnaire.zip
"
><date notBefore=
"
2017-09-29
"
/></ref></edition><respStmt><resp>contributor</resp><name key=
"
442239
"
><persName><forename>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>f85a43a5fb4a2e0778a77e017f28c8fd</email><email type=
"
domain
"
>gmail.com</email></name></respStmt></editionStmt><publicationStmt><distributor>CCSD</distributor><idno type=
"
halId
"
>hal-01587083</idno><idno type=
"
halUri
"
>https://hal.inria.fr/hal-01587083</idno><idno type=
"
halBibtex
"
>gruenpeter:hal-01587083</idno><idno type=
"
halRefHtml
"
>2017</idno><idno type=
"
halRef
"
>2017</idno></publicationStmt><seriesStmt/><notesStmt/><sourceDesc><biblStruct><analytic><title xml:lang=
"
en
"
>questionnaire software metadata</title><author role=
"
aut
"
><persName><forename type=
"
first
"
>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>7de56c632362954fa84172cad80afe4e</email><email type=
"
domain
"
>inria.fr</email><ptr type=
"
url
"
target=
"
moranegg.github.io
"
/><idno type=
"
halauthorid
"
>1556733</idno><affiliation ref=
"
#struct-474639
"
/></author></analytic><monogr><imprint/></monogr></biblStruct></sourceDesc><profileDesc><langUsage><language ident=
"
en
"
>English</language></langUsage><textClass><classCode scheme=
"
halDomain
"
n=
"
info
"
>Computer Science [cs]</classCode><classCode scheme=
"
halTypology
"
n=
"
SOFTWARE
"
>Software</classCode></textClass></profileDesc></biblFull></listBibl></body><back><listOrg type=
"
structures
"
><org type=
"
laboratory
"
xml:id=
"
struct-474639
"
status=
"
VALID
"
><orgName>IRILL</orgName><orgName type=
"
acronym
"
>Initiative pour la Recherche et l
'
Innovation sur le Logiciel Libre</orgName><desc><address><country key=
"
FR
"
/></address><ref type=
"
url
"
>https://www.irill.org/</ref></desc><listRelation><relation active=
"
#struct-93591
"
type=
"
direct
"
/><relation active=
"
#struct-300009
"
type=
"
direct
"
/><relation active=
"
#struct-300301
"
type=
"
direct
"
/></listRelation></org><org type=
"
institution
"
xml:id=
"
struct-93591
"
status=
"
VALID
"
><orgName>Universite Pierre et Marie Curie - Paris 6</orgName><orgName type=
"
acronym
"
>UPMC</orgName><desc><address><addrLine>4 place Jussieu - 75005 Paris</addrLine><country key=
"
FR
"
/></address><ref type=
"
url
"
>http://www.upmc.fr/</ref></desc></org><org type=
"
institution
"
xml:id=
"
struct-300009
"
status=
"
VALID
"
><orgName>Institut National de Recherche en Informatique et en Automatique</orgName><orgName type=
"
acronym
"
>Inria</orgName><desc><address><addrLine>Domaine de VoluceauRocquencourt - BP 10578153 Le Chesnay Cedex</addrLine><country key=
"
FR
"
/></address><ref type=
"
url
"
>http://www.inria.fr/en/</ref></desc></org><org type=
"
institution
"
xml:id=
"
struct-300301
"
status=
"
VALID
"
><orgName>Universite Paris Diderot - Paris 7</orgName><orgName type=
"
acronym
"
>UPD7</orgName><desc><address><addrLine>5 rue Thomas-Mann - 75205 Paris cedex 13</addrLine><country key=
"
FR
"
/></address><ref type=
"
url
"
>http://www.univ-paris-diderot.fr</ref></desc></org></listOrg></back></text></TEI>
"""
# noqa
self
.
atom_entry_tei
=
b
"""
<TEI><teiHeader><fileDesc><titleStmt><title>HAL TEI export of hal-01587083</title></titleStmt><publicationStmt><distributor>CCSD</distributor><availability status=
"
restricted
"
><licence target=
"
http://creativecommons.org/licenses/by/4.0/
"
>Distributed under a Creative Commons Attribution 4.0 International License</licence></availability><date when=
"
2017-10-03T17:21:03+02:00
"
/></publicationStmt><sourceDesc><p part=
"
N
"
>HAL API platform</p></sourceDesc></fileDesc></teiHeader><text><body><listBibl><biblFull><titleStmt><title xml:lang=
"
en
"
>questionnaire software metadata</title><author role=
"
aut
"
><persName><forename type=
"
first
"
>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>7de56c632362954fa84172cad80afe4e</email><email type=
"
domain
"
>inria.fr</email><ptr type=
"
url
"
target=
"
moranegg.github.io
"
/><idno type=
"
halauthorid
"
>1556733</idno><affiliation ref=
"
#struct-474639
"
/></author><editor role=
"
depositor
"
><persName><forename>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>f85a43a5fb4a2e0778a77e017f28c8fd</email><email type=
"
domain
"
>gmail.com</email></editor></titleStmt><editionStmt><edition n=
"
v1
"
type=
"
current
"
><date type=
"
whenSubmitted
"
>2017-09-29 11:21:32</date><date type=
"
whenModified
"
>2017-10-03 17:20:13</date><date type=
"
whenReleased
"
>2017-10-03 17:20:13</date><date type=
"
whenProduced
"
>2017-09-29</date><date type=
"
whenEndEmbargoed
"
>2017-09-29</date><ref type=
"
file
"
target=
"
https://hal.inria.fr/hal-01587083/document
"
><date notBefore=
"
2017-09-29
"
/></ref><ref type=
"
file
"
subtype=
"
author
"
n=
"
1
"
target=
"
https://hal.inria.fr/hal-01587083/file/questionnaire.zip
"
><date notBefore=
"
2017-09-29
"
/></ref></edition><respStmt><resp>contributor</resp><name key=
"
442239
"
><persName><forename>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>f85a43a5fb4a2e0778a77e017f28c8fd</email><email type=
"
domain
"
>gmail.com</email></name></respStmt></editionStmt><publicationStmt><distributor>CCSD</distributor><idno type=
"
halId
"
>hal-01587083</idno><idno type=
"
halUri
"
>https://hal.inria.fr/hal-01587083</idno><idno type=
"
halBibtex
"
>gruenpeter:hal-01587083</idno><idno type=
"
halRefHtml
"
>2017</idno><idno type=
"
halRef
"
>2017</idno></publicationStmt><seriesStmt/><notesStmt/><sourceDesc><biblStruct><analytic><title xml:lang=
"
en
"
>questionnaire software metadata</title><author role=
"
aut
"
><persName><forename type=
"
first
"
>Morane</forename><surname>Gruenpeter</surname></persName><email type=
"
md5
"
>7de56c632362954fa84172cad80afe4e</email><email type=
"
domain
"
>inria.fr</email><ptr type=
"
url
"
target=
"
moranegg.github.io
"
/><idno type=
"
halauthorid
"
>1556733</idno><affiliation ref=
"
#struct-474639
"
/></author></analytic><monogr><imprint/></monogr></biblStruct></sourceDesc><profileDesc><langUsage><language ident=
"
en
"
>English</language></langUsage><textClass><classCode scheme=
"
halDomain
"
n=
"
info
"
>Computer Science [cs]</classCode><classCode scheme=
"
halTypology
"
n=
"
SOFTWARE
"
>Software</classCode></textClass></profileDesc></biblFull></listBibl></body><back><listOrg type=
"
structures
"
><org type=
"
laboratory
"
xml:id=
"
struct-474639
"
status=
"
VALID
"
><orgName>IRILL</orgName><orgName type=
"
acronym
"
>Initiative pour la Recherche et l
'
Innovation sur le Logiciel Libre</orgName><desc><address><country key=
"
FR
"
/></address><ref type=
"
url
"
>https://www.irill.org/</ref></desc><listRelation><relation active=
"
#struct-93591
"
type=
"
direct
"
/><relation active=
"
#struct-300009
"
type=
"
direct
"
/><relation active=
"
#struct-300301
"
type=
"
direct
"
/></listRelation></org><org type=
"
institution
"
xml:id=
"
struct-93591
"
status=
"
VALID
"
><orgName>Universite Pierre et Marie Curie - Paris 6</orgName><orgName type=
"
acronym
"
>UPMC</orgName><desc><address><addrLine>4 place Jussieu - 75005 Paris</addrLine><country key=
"
FR
"
/></address><ref type=
"
url
"
>http://www.upmc.fr/</ref></desc></org><org type=
"
institution
"
xml:id=
"
struct-300009
"
status=
"
VALID
"
><orgName>Institut National de Recherche en Informatique et en Automatique</orgName><orgName type=
"
acronym
"
>Inria</orgName><desc><address><addrLine>Domaine de VoluceauRocquencourt - BP 10578153 Le Chesnay Cedex</addrLine><country key=
"
FR
"
/></address><ref type=
"
url
"
>http://www.inria.fr/en/</ref></desc></org><org type=
"
institution
"
xml:id=
"
struct-300301
"
status=
"
VALID
"
><orgName>Universite Paris Diderot - Paris 7</orgName><orgName type=
"
acronym
"
>UPD7</orgName><desc><address><addrLine>5 rue Thomas-Mann - 75205 Paris cedex 13</addrLine><country key=
"
FR
"
/></address><ref type=
"
url
"
>http://www.univ-paris-diderot.fr</ref></desc></org></listOrg></back></text></TEI>
"""
# noqa
self
.
atom_entry_data_badly_formatted
=
b
"""
<?xml version=
"
1.0
"
?>
<entry xmlns=
"
http://www.w3.org/2005/Atom
"
</entry>
"""
def
test_post_deposit_atom_empty_body_request
(
self
):
def
test_post_deposit_atom_empty_body_request
(
self
):
response
=
self
.
client
.
post
(
response
=
self
.
client
.
post
(
reverse
(
COL_IRI
,
args
=
[
self
.
username
]),
reverse
(
COL_IRI
,
args
=
[
self
.
username
]),
...
@@ -96,6 +99,13 @@ and other stuff</description>
...
@@ -96,6 +99,13 @@ and other stuff</description>
data
=
self
.
atom_entry_data_empty_body
)
data
=
self
.
atom_entry_data_empty_body
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
def
test_post_deposit_atom_badly_formatted_is_a_bad_request
(
self
):
response
=
self
.
client
.
post
(
reverse
(
COL_IRI
,
args
=
[
self
.
username
]),
content_type
=
'
application/atom+xml;type=entry
'
,
data
=
self
.
atom_entry_data_badly_formatted
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
def
test_post_deposit_atom_unknown_collection
(
self
):
def
test_post_deposit_atom_unknown_collection
(
self
):
response
=
self
.
client
.
post
(
response
=
self
.
client
.
post
(
reverse
(
COL_IRI
,
args
=
[
'
unknown-one
'
]),
reverse
(
COL_IRI
,
args
=
[
'
unknown-one
'
]),
...
...
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