Skip to content

Commit

Permalink
create test data
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya-Oladazimi committed Dec 16, 2024
1 parent 2ac9156 commit e72d2ee
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions ckanext/dataset_reference/tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,37 @@ class TestControllers(object):

@pytest.fixture(autouse=True)
def intial(self):
pass

ctd.CreateTestData.create()
sysadmin_user = model.User.get("testsysadmin")
self.auth = {u"Authorization": str(sysadmin_user.apikey)}



# @pytest.mark.usefixtures('clean_db', 'with_plugins', 'with_request_context')
# def test_add_reference_with_doi_when_doi_is_valid(self, app, migrate_db_for):
# '''
# A user has to be able to add a reference
# with a doi url
# '''
# # ctd.CreateTestData.create()
# migrate_db_for("dataset_reference")
# sysadmin_user = model.User.get("testsysadmin")
# owner_org = factories.Organization(users=[{
# 'name': sysadmin_user.id,
# 'capacity': 'member'
# }])
# dataset = factories.Dataset(owner_org=owner_org['id'])
# auth = {u"Authorization": str(sysadmin_user.apikey)}
# data = {
# 'package_id': dataset['id'],
# 'doi_or_bibtex': 'doi',
# 'doi': 'https://doi.org/10.1007/978-3-030-57717-9_36'
# }
# dest_url = h.url_for('dataset_reference.save_doi')
# response = app.post(dest_url, data=data, extra_environ=auth)
# assert response.status_code == 200
# assert True == True



def test_doi_is_valid_call(self, app):
Expand Down

0 comments on commit e72d2ee

Please sign in to comment.