Skip to content

Commit

Permalink
Fix test_create_list_delete_fov error
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Mar 21, 2024
1 parent eacd85a commit 8c8b1c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion alyx/alyx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import sys
import pytz
import uuid
from collections import OrderedDict
import one.alf.spec
from datetime import datetime
import traceback
Expand Down
12 changes: 4 additions & 8 deletions alyx/experiments/tests_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from django.contrib.auth import get_user_model
from django.urls import reverse
from django.core.management import call_command
from django.db import transaction

from alyx.base import BaseTests
Expand All @@ -15,9 +14,9 @@

class APIProbeExperimentTests(BaseTests):

fixtures = ['experiments.brainregion.json', 'experiments.probemodel.json']

def setUp(self):
call_command('loaddata', 'experiments/fixtures/experiments.probemodel.json', verbosity=0)
call_command('loaddata', 'experiments/fixtures/experiments.brainregion.json', verbosity=0)
self.superuser = get_user_model().objects.create_superuser('test', 'test', 'test')
self.client.login(username='test', password='test')
self.session = Session.objects.first()
Expand Down Expand Up @@ -398,12 +397,9 @@ def test_dataset_filters(self):


class APIImagingExperimentTests(BaseTests):
fixtures = ['experiments.brainregion.json', 'experiments.coordinatesystem.json']

def setUp(self):
call_command('loaddata', 'experiments/fixtures/experiments.brainregion.json', verbosity=0)
call_command(
'loaddata', 'experiments/fixtures/experiments.coordinatesystem.json', verbosity=0
)
self.superuser = get_user_model().objects.create_superuser('test', 'test', 'test')
self.client.login(username='test', password='test')
# self.session = Session.objects.first()
Expand Down Expand Up @@ -465,7 +461,7 @@ def test_create_list_delete_fov(self):
url = reverse('fovlocation-list')
with transaction.atomic():
response = self.post(url, loc_dict)
self.ar(response, 500)
self.assertIn(response.status_code, (400, 500)) # In later versions status code is 400

url = reverse('fieldsofview-list')
# FOV location containing atlas ID 9 should no longer be default provenance and therefore
Expand Down

0 comments on commit 8c8b1c2

Please sign in to comment.