Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Carlos Ribas
rnacentral-webcode
Commits
b41e904a
Commit
b41e904a
authored
Apr 07, 2021
by
carlosribas
Browse files
Backup old tests for reference and create new tests
parent
d573a9c4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
0 deletions
+92
-0
rnacentral/portal/tests/test_rna_type.py
rnacentral/portal/tests/test_rna_type.py
+0
-0
rnacentral/portal/tests/test_views.py
rnacentral/portal/tests/test_views.py
+92
-0
rnacentral/portal/tests_backup/__init__.py
rnacentral/portal/tests_backup/__init__.py
+0
-0
rnacentral/portal/tests_backup/description_tests.py
rnacentral/portal/tests_backup/description_tests.py
+0
-0
rnacentral/portal/tests_backup/management/__init__.py
rnacentral/portal/tests_backup/management/__init__.py
+0
-0
rnacentral/portal/tests_backup/management/commands/__init__.py
...ntral/portal/tests_backup/management/commands/__init__.py
+0
-0
rnacentral/portal/tests_backup/management/commands/ensembl_export_tests.py
.../tests_backup/management/commands/ensembl_export_tests.py
+0
-0
rnacentral/portal/tests_backup/selenium_tests.py
rnacentral/portal/tests_backup/selenium_tests.py
+0
-0
No files found.
rnacentral/portal/tests/rna_type
_tests
.py
→
rnacentral/portal/tests/
test_
rna_type.py
View file @
b41e904a
File moved
rnacentral/portal/tests/test_views.py
0 → 100644
View file @
b41e904a
from
django.test
import
TestCase
from
django.urls
import
resolve
,
reverse
from
portal.views
import
homepage
,
rna_view
,
rna_view_redirect
,
expert_database_view
class
PortalTest
(
TestCase
):
def
setUp
(
self
):
self
.
upi
=
'URS0000000001'
self
.
taxid
=
'77133'
self
.
expert_db
=
'mirbase'
########################
# homepage
########################
def
test_homepage_url
(
self
):
view
=
resolve
(
'/'
)
self
.
assertEqual
(
view
.
func
,
homepage
)
def
test_homepage_status_code
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'homepage'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_homepage_template
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'homepage'
))
self
.
assertTemplateUsed
(
response
,
'portal/homepage.html'
)
########################
# unique RNA sequence
########################
def
test_rna_view_url
(
self
):
view
=
resolve
(
'/rna/'
+
self
.
upi
)
self
.
assertEqual
(
view
.
func
,
rna_view
)
def
test_rna_view_status_code
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'unique-rna-sequence'
,
kwargs
=
{
'upi'
:
self
.
upi
}))
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_rna_view_404
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'unique-rna-sequence'
,
kwargs
=
{
'upi'
:
'URS9999999999'
}))
self
.
assertEqual
(
response
.
status_code
,
404
)
def
test_rna_view_with_taxid_status_code
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'unique-rna-sequence'
,
kwargs
=
{
'upi'
:
self
.
upi
,
'taxid'
:
self
.
taxid
}))
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_rna_view_template
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'unique-rna-sequence'
,
kwargs
=
{
'upi'
:
self
.
upi
}))
self
.
assertTemplateUsed
(
response
,
'portal/sequence.html'
)
########################
# species specific identifier with underscore
########################
def
test_rna_view_redirect_url
(
self
):
view
=
resolve
(
'/rna/'
+
self
.
upi
+
'_'
+
self
.
taxid
)
self
.
assertEqual
(
view
.
func
,
rna_view_redirect
)
def
test_rna_view_redirect_status_code
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'unique-rna-sequence-redirect'
,
kwargs
=
{
'upi'
:
self
.
upi
,
'taxid'
:
self
.
taxid
})
)
self
.
assertEqual
(
response
.
status_code
,
301
)
########################
# expert database
########################
def
test_expert_database_view_url
(
self
):
view
=
resolve
(
'/expert-database/'
+
self
.
expert_db
)
self
.
assertEqual
(
view
.
func
,
expert_database_view
)
def
test_expert_database_status_code
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'expert-database'
,
kwargs
=
{
'expert_db_name'
:
self
.
expert_db
}))
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_expert_database_404
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'expert-database'
,
kwargs
=
{
'expert_db_name'
:
'test'
}))
self
.
assertEqual
(
response
.
status_code
,
404
)
def
test_expert_database_template
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'expert-database'
,
kwargs
=
{
'expert_db_name'
:
'tmrna-website'
}))
self
.
assertTemplateUsed
(
response
,
'portal/expert-database.html'
)
########################
# text search
########################
def
test_text_search_status_code
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'text-search'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_text_search_template
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'text-search'
))
self
.
assertTemplateUsed
(
response
,
'portal/base.html'
)
rnacentral/portal/tests
/management
/__init__.py
→
rnacentral/portal/tests
_backup
/__init__.py
View file @
b41e904a
File moved
rnacentral/portal/tests/description_tests.py
→
rnacentral/portal/tests
_backup
/description_tests.py
View file @
b41e904a
File moved
rnacentral/portal/tests/management/
commands/
__init__.py
→
rnacentral/portal/tests
_backup
/management/__init__.py
View file @
b41e904a
File moved
rnacentral/portal/tests_backup/management/commands/__init__.py
0 → 100644
View file @
b41e904a
rnacentral/portal/tests/management/commands/ensembl_export_tests.py
→
rnacentral/portal/tests
_backup
/management/commands/ensembl_export_tests.py
View file @
b41e904a
File moved
rnacentral/portal/tests/selenium_tests.py
→
rnacentral/portal/tests
_backup
/selenium_tests.py
View file @
b41e904a
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment