Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datasets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ class DatasetRelease(models.Model):
('PU', 'Public release'),
)
type = models.CharField(max_length=2, choices=TYPE_CHOICES, default='IN')
release_data = JSONField(default={})
taxonomy_node_stats = JSONField(default=[])
release_data = JSONField(default=dict)
taxonomy_node_stats = JSONField(default=list)

@property
def avg_annotations_per_sound(self):
Expand Down
2 changes: 1 addition & 1 deletion datasets/templates/datasets/dataset_release_explore.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% load staticfiles %}
{% load static %}
{% load humanize %}
{% block title %}Explore{% endblock title %}
{% block page_js %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% load staticfiles %}
{% load static %}
{% load dataset_templatetags %}
{% load general_templatetags %}
{% block title %}{{ node.name }}{% endblock title %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
{% load dataset_templatetags %}
{% load general_templatetags %}
{% block extra_head %}
Expand Down
54 changes: 27 additions & 27 deletions datasets/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def test_save_contribute_validate_annotations_category(self):

# check the response an that a vote is added in the database
response = self.client.post(reverse('save-contribute-validate-annotations-per-category'), data=form_data)
self.assertEquals(response.status_code, 200)
self.assertEquals(Vote.objects.filter(candidate_annotation_id=annotation_object_id).count(), 1)
self.assertEqual(response.status_code, 200)
self.assertEqual(Vote.objects.filter(candidate_annotation_id=annotation_object_id).count(), 1)

# check that a second vote is not added, or modified
form_data['form-0-vote'] = '-1'
self.client.post(reverse('save-contribute-validate-annotations-per-category'), data=form_data)
self.assertEquals(Vote.objects.filter(candidate_annotation_id=annotation_object_id).count(), 1)
self.assertEquals(Vote.objects.get(candidate_annotation_id=annotation_object_id).vote, 1)
self.assertEqual(Vote.objects.filter(candidate_annotation_id=annotation_object_id).count(), 1)
self.assertEqual(Vote.objects.get(candidate_annotation_id=annotation_object_id).vote, 1)


class AdvancedContributeTest(TestCase):
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_first_page_duration(self):
'node_id': node_url,
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)
selected_candidates = sorted([form[0].id for form in response.context['annotations_forms']])
self.assertListEqual(expected_annotation_ids, selected_candidates)

Expand All @@ -120,7 +120,7 @@ def test_second_page_duration(self):
'node_id': node_url,
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)
selected_candidates = [form[0].id for form in response.context['annotations_forms']]

# create form data with the 12 annotation vote forms
Expand All @@ -141,15 +141,15 @@ def test_second_page_duration(self):

# submit form
response = self.client.post(reverse('save-contribute-validate-annotations-per-category'), data=form_data)
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

# get the candidates second page
response = self.client.get(reverse('contribute-validate-annotations-category',
kwargs={
'node_id': node_url,
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

# check that the selected candidates correspond to the 12 sounds with duration > 10 sec
expected_annotation_ids = sorted(CandidateAnnotation.objects
Expand Down Expand Up @@ -211,7 +211,7 @@ def test_create_release_launch(self):
'short_name': 'fsd'
}),
data=form_data)
self.assertEquals(response.status_code, 302) # http redirect
self.assertEqual(response.status_code, 302) # http redirect

# check that the release has been correctly created
release = DatasetRelease.objects.first()
Expand All @@ -237,7 +237,7 @@ def test_release_explore(self):
'release_tag': 'test'
}))

self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['release'].release_tag, 'test')

def test_download_release(self):
Expand All @@ -262,7 +262,7 @@ def test_delete_release(self):
}))

self.assertEqual(list(DatasetRelease.objects.all()), [])
self.assertEquals(response.status_code, 302) # http redirect
self.assertEqual(response.status_code, 302) # http redirect

def test_release_table(self):
create_release()
Expand Down Expand Up @@ -354,114 +354,114 @@ def test_dataset(self):
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_dataset_explore(self):
response = self.client.get(reverse('dataset-explore',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_dataset_taxonomy_tree(self):
response = self.client.get(reverse('taxonomy-tree',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_dataset_taxonomy_table(self):
response = self.client.get(reverse('taxonomy-table',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_dataset_state_table(self):
response = self.client.get(reverse('state-table',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_taxonomy_node(self):
response = self.client.get(reverse('dataset-explore-taxonomy-node',
kwargs={
'short_name': 'fsd',
'node_id': self.node_with_candidates.url_id
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_contribute(self):
response = self.client.get(reverse('contribute',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_contribute_validate_annotations(self):
response = self.client.get(reverse('contribute-validate-annotations-category',
kwargs={
'short_name': 'fsd',
'node_id': self.node_with_candidates.url_id
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_contribute_validate_annotations_easy(self):
response = self.client.get(reverse('contribute-validate-annotations-category-beginner',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_contribute_validate_annotations_all(self):
response = self.client.get(reverse('contribute-validate-annotations-all',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_contribute_validate_annotations_category(self):
response = self.client.get(reverse('contribute-validate-annotations-category',
kwargs={
'short_name': 'fsd',
'node_id': self.node_with_candidates.url_id
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_choose_category(self):
response = self.client.get(reverse('choose_category',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_dataset_taxonomy_table_choose(self):
response = self.client.get(reverse('dataset_taxonomy_table_choose',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_dataset_taxonomy_table_search(self):
response = self.client.get(reverse('taxonomy-table-search',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_dataset_taxonomy_table_search_all(self):
response = self.client.get(reverse('taxonomy-table-search-all',
kwargs={
'short_name': 'fsd'
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_get_mini_node_info(self):
response = self.client.get(reverse('get-mini-node-info',
kwargs={
'short_name': 'fsd',
'node_id': self.node_with_candidates.url_id
}))
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
celery==4.1.1
dj-database-url==0.4.1
django-debug-toolbar==1.11.1
django-debug-toolbar==3.2.2
django-extensions==2.1.2
django==2.2.24
django==3.2.7
ipython==5.3.0
markdown==2.6.8
nltk==3.4.5
psycopg2==2.7.7 --no-binary psycopg2
pygments==2.7.4
sentry-sdk==0.14.4
redis==3.2.0
social-auth-app-django==4.0.0
social-auth-app-django==5.0.0
uwsgi==2.0.18