Skip to content

Commit

Permalink
upgrade to django-sodar-core v1.0.1, fix search tests (#1922)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Aug 8, 2024
1 parent 71ce6f0 commit e8c6b42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ mistune==3.0.2
django-autocomplete-light==3.11.0

# SODAR Core
# django-sodar-core==1.0.0
-e git+https://github.com/bihealth/sodar-core.git@70332724630a679c2358e053c48e57530aa3ee8a#egg=django-sodar-core
django-sodar-core==1.0.1
# -e git+https://github.com/bihealth/sodar-core.git@d63e5e1031e862679ce5dda776c250eb0d219537#egg=django-sodar-core

# Celery
celery==5.3.6
Expand Down
4 changes: 1 addition & 3 deletions samplesheets/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,9 +1497,7 @@ class TestProjectSearchResultsView(SamplesheetsViewTestBase):
"""Tests for ProjectSearchResultsView view with sample sheet input"""

def _get_items(self, response):
return response.context['app_results'][0]['results']['materials'][
'items'
]
return response.context['app_results'][0]['results']['materials'].items

def setUp(self):
super().setUp()
Expand Down
20 changes: 10 additions & 10 deletions samplesheets/tests/test_views_taskflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2552,13 +2552,13 @@ def test_search(self):
self.assertEqual(response.status_code, 200)
data = response.context['app_results'][0]
self.assertEqual(len(data['results']), 2)
self.assertEqual(len(data['results']['materials']['items']), 1)
self.assertEqual(len(data['results']['materials'].items), 1)
self.assertEqual(
data['results']['materials']['items'][0]['name'], SAMPLE_ID
data['results']['materials'].items[0]['name'], SAMPLE_ID
)
self.assertEqual(len(data['results']['files']['items']), 1)
self.assertEqual(len(data['results']['files'].items), 1)
self.assertEqual(
data['results']['files']['items'][0]['name'], self.file_name
data['results']['files'].items[0]['name'], self.file_name
)

def test_search_limit_source(self):
Expand All @@ -2572,9 +2572,9 @@ def test_search_limit_source(self):
self.assertEqual(response.status_code, 200)
data = response.context['app_results'][0]
self.assertEqual(len(data['results']), 1)
self.assertEqual(len(data['results']['materials']['items']), 1)
self.assertEqual(len(data['results']['materials'].items), 1)
self.assertEqual(
data['results']['materials']['items'][0]['name'], SOURCE_ID
data['results']['materials'].items[0]['name'], SOURCE_ID
)

def test_search_limit_sample(self):
Expand All @@ -2588,9 +2588,9 @@ def test_search_limit_sample(self):
self.assertEqual(response.status_code, 200)
data = response.context['app_results'][0]
self.assertEqual(len(data['results']), 1)
self.assertEqual(len(data['results']['materials']['items']), 1)
self.assertEqual(len(data['results']['materials'].items), 1)
self.assertEqual(
data['results']['materials']['items'][0]['name'], SAMPLE_ID
data['results']['materials'].items[0]['name'], SAMPLE_ID
)

def test_search_limit_file(self):
Expand All @@ -2604,9 +2604,9 @@ def test_search_limit_file(self):
self.assertEqual(response.status_code, 200)
data = response.context['app_results'][0]
self.assertEqual(len(data['results']), 1)
self.assertEqual(len(data['results']['files']['items']), 1)
self.assertEqual(len(data['results']['files'].items), 1)
self.assertEqual(
data['results']['files']['items'][0]['name'], self.file_name
data['results']['files'].items[0]['name'], self.file_name
)


Expand Down

0 comments on commit e8c6b42

Please sign in to comment.