Skip to content

Commit

Permalink
Merge branch 'feature/django_upgrade' of https://github.com/CenterFor…
Browse files Browse the repository at this point in the history
…OpenScience/osf.io into upguard-indexes

* 'feature/django_upgrade' of https://github.com/CenterForOpenScience/osf.io:
  [ENG-3836] Follow-up: Add PyYAML to Requirements (CenterForOpenScience#9993)
  • Loading branch information
John Tordoff committed Jul 27, 2022
2 parents ae0a412 + 8052ea4 commit e364d68
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion osf_tests/test_file_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from osf_tests.factories import ProjectFactory, SubjectFactory, AuthUserFactory
from osf.utils.permissions import READ
from api_tests.utils import create_test_file

from osf.migrations import add_datacite_schema

@pytest.fixture()
def node():
Expand All @@ -31,6 +31,10 @@ def inject_placeholder_doi(json_data):
@pytest.mark.django_db
class TestFileMetadataRecordSerializer:

@pytest.fixture(autouse=True)
def datacite_file_schema(self):
return add_datacite_schema()

def test_record_created_post_save(self, node, osf_file):
# check there's a record for every FileMetadataSchema
assert FileMetadataSchema.objects.count() > 0
Expand Down Expand Up @@ -122,6 +126,10 @@ def test_validate(self, node, osf_file):
@pytest.mark.django_db
class TestFileMetadataRecord:

@pytest.fixture(autouse=True)
def datacite_file_schema(self):
return add_datacite_schema()

@pytest.fixture()
def initial_metadata(self):
return {
Expand Down
6 changes: 6 additions & 0 deletions osf_tests/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
from .factories import get_default_metaschema
from addons.wiki.tests.factories import WikiVersionFactory, WikiFactory
from osf_tests.utils import capture_signals, assert_datetime_equal, mock_archive
from osf.migrations import ensure_default_registration_provider

pytestmark = pytest.mark.django_db

Expand Down Expand Up @@ -2420,6 +2421,11 @@ def test_confirm_spam_makes_node_private(self, project):

# copied from tests/test_models.py
class TestPrivateLinks:

@pytest.fixture(autouse=True)
def default_registration_provider(self):
ensure_default_registration_provider()

def test_add_private_link(self, node):
link = PrivateLinkFactory()
link.nodes.add(node)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ citeproc-py==0.4.0
boto3==1.4.7
django-waffle==2.4.1
pymongo==3.7.1
PyYAML==6.0
tqdm==4.28.1
# Python markdown extensions for comment emails
git+https://github.com/Johnetordoff/mdx_del_ins.git@django-3
Expand Down

0 comments on commit e364d68

Please sign in to comment.