Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudDauce committed Apr 3, 2024
1 parent 4643684 commit b0093c3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion udata_front/tests/views/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_200_if_deleted_but_authorized(self):

def test_no_index_on_empty(self):
'''It should prevent crawlers from indexing empty datasets'''
dataset = DatasetFactory()
dataset = DatasetFactory(private=True)
response = self.get(url_for('datasets.show', dataset=dataset))
self.assert200(response)
self.assertIn(b'<meta name="robots" content="noindex, nofollow"',
Expand Down
10 changes: 1 addition & 9 deletions udata_front/tests/views/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ def test_render_display_with_private_datasets(self):
# so private datasets are omitted
datasets = [
DatasetFactory(organization=organization) for _ in range(2)]
empty_datasets = [
DatasetFactory(organization=organization, resources=[]) for _ in range(1)]
[DatasetFactory(organization=organization, private=True) for _ in range(1)]
response = self.get(url_for('organizations.show', org=organization))

Expand All @@ -128,13 +126,7 @@ def test_render_display_with_private_datasets(self):
rendered_private_datasets = [dataset for dataset in rendered_datasets if dataset.private]
self.assertEqual(len(rendered_private_datasets), 0)

rendered_empty_datasets = [
dataset for dataset in rendered_datasets if len(dataset.resources) == 0
]
self.assertEqual(len(rendered_empty_datasets), len(empty_datasets))

self.assertEqual(rendered_datasets.total,
len(datasets) + len(empty_datasets))
self.assertEqual(rendered_datasets.total, len(datasets))

def test_render_display_with_paginated_datasets(self):
'''It should render the organization page with paginated datasets'''
Expand Down
1 change: 0 additions & 1 deletion udata_front/tests/views/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def test_datasets_csv(self):
self.app.config['EXPORT_CSV_MODELS'] = []
datasets = [DatasetFactory(resources=[ResourceFactory()])
for _ in range(5)]
hidden_dataset = DatasetFactory()

response = self.get(url_for('site.datasets_csv'))

Expand Down

0 comments on commit b0093c3

Please sign in to comment.