Skip to content

Commit

Permalink
Merge branch 'canada-v2.9' into staging-v2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
JVickery-TBS committed Jul 13, 2023
2 parents 7c6a4e8 + 3cebc06 commit 49a04fd
Show file tree
Hide file tree
Showing 27 changed files with 151 additions and 154 deletions.
12 changes: 8 additions & 4 deletions ckanext/canada/i18n/en/LC_MESSAGES/ckanext-canada.po
Original file line number Diff line number Diff line change
Expand Up @@ -6165,6 +6165,14 @@ msgstr ""
msgid "Search and view users."
msgstr ""

#: ckanext/canada/validators.py:382
msgid "Invalid JSON for Schema"
msgstr ""

#: ckanext/canada/validators.py:385
msgid "Schema URLs are not supported"
msgstr ""

#: ckanext/canada/templates/internal/package/read.html:6
msgid "Your record will be published at:"
msgstr ""
Expand All @@ -6180,7 +6188,3 @@ msgstr ""
#: ckanext/canada/templates/internal/package/read.html:16
msgid "Queued for publishing"
msgstr ""

#: ckanext/canada/validators.py:382
msgid "Invalid JSON for Schema"
msgstr ""
12 changes: 8 additions & 4 deletions ckanext/canada/i18n/fr/LC_MESSAGES/ckanext-canada.po
Original file line number Diff line number Diff line change
Expand Up @@ -3643,6 +3643,14 @@ msgstr "Rechercher et gérer les utilisateurs."
msgid "Search and view users."
msgstr "Rechercher et afficher les utilisateurs."

#: ckanext/canada/validators.py:382
msgid "Invalid JSON for Schema"
msgstr "JSON non valide pour le schéma"

#: ckanext/canada/validators.py:385
msgid "Schema URLs are not supported"
msgstr "Les adresses URL des schémas ne sont pas prises en charge"

#: ckanext/canada/templates/internal/package/read.html:6
msgid "Your record will be published at:"
msgstr "Votre document sera publié à :"
Expand All @@ -3658,7 +3666,3 @@ msgstr "Approbation nécessaire"
#: ckanext/canada/templates/internal/package/read.html:16
msgid "Queued for publishing"
msgstr "Mis en file d'attente à des fins de publication"

#: ckanext/canada/validators.py:382
msgid "Invalid JSON for Schema"
msgstr "JSON non valide pour le schéma"
2 changes: 1 addition & 1 deletion ckanext/canada/templates/internal/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block internal_actions %}
<section class="resources module-content indent-large">
{% set portal_link = h.portal_url() ~ "/data/" ~ client_lang ~ "/" ~ pkg.name %}
{% set portal_link = h.portal_url() ~ "/data/" ~ client_lang ~ "/" ~ pkg.get('type', 'dataset') ~ "/" ~ pkg.name %}
{% set sub_label = _("Your record will be published at:") %}
{% set alert_class = "info" %}
{% set show_portal_status_alert = true %}
Expand Down
17 changes: 17 additions & 0 deletions ckanext/canada/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.validation.model import (
create_tables as validation_create_tables,
tables_exist as validation_tables_exist
)

class CanadaTestBase(object):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
if not validation_tables_exist():
validation_create_tables()
reset_db()
clear_all()
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_alerts.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckan.plugins.toolkit import h
from ckanapi import LocalCKAN

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckan.tests.factories import Sysadmin
from ckanext.canada.tests.factories import CanadaOrganization as Organization


@pytest.mark.usefixtures('with_request_context')
class TestPackageAlerts(object):
class TestPackageAlerts(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestPackageAlerts, self).setup_method(method)

self.sysadmin = Sysadmin()
self.extra_environ_tester = {'REMOTE_USER': self.sysadmin['name'].encode('ascii')}
Expand Down
13 changes: 5 additions & 8 deletions ckanext/canada/tests/test_ati.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestAti(object):
class TestAti(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestAti, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down Expand Up @@ -44,14 +42,13 @@ def test_blank(self):
assert 'request_number' in err['key'][0]


class TestAtiNil(object):
class TestAtiNil(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestAtiNil, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_briefingt.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestBriefingT(object):
class TestBriefingT(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestBriefingT, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_consultations.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestConsultations(object):
class TestConsultations(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestConsultations, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_contracts.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestContracts(object):
class TestContracts(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestContracts, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_contractsa.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestContractsA(object):
class TestContractsA(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestContractsA, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_dac.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo
from ckanext.recombinant.helpers import recombinant_choice_fields


class TestDAC(object):
class TestDAC(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestDAC, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_experiment.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestExperiment(object):
class TestExperiment(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestExperiment, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
8 changes: 3 additions & 5 deletions ckanext/canada/tests/test_grants.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestGrants(object):
class TestGrants(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestGrants, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
13 changes: 5 additions & 8 deletions ckanext/canada/tests/test_hospitalityq.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# -*- coding: UTF-8 -*-
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

import pytest
from ckan.tests.helpers import reset_db
from ckan.lib.search import clear_all
from ckanext.canada.tests.factories import CanadaOrganization as Organization

from ckanext.recombinant.tables import get_chromo


class TestHospitalityQ(object):
class TestHospitalityQ(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestHospitalityQ, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down Expand Up @@ -44,14 +42,13 @@ def test_blank(self):
assert 'ref_number' in err['key'][0]


class TestHospitalityQNil(object):
class TestHospitalityQNil(CanadaTestBase):
@classmethod
def setup_method(self, method):
"""Method is called at class level before EACH test methods of the class are called.
Setup any state specific to the execution of the given class methods.
"""
reset_db()
clear_all()
super(TestHospitalityQNil, self).setup_method(method)

org = Organization()
self.lc = LocalCKAN()
Expand Down
Loading

0 comments on commit 49a04fd

Please sign in to comment.