-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #754 from cortex-lab/dev
Dev
- Loading branch information
Showing
6 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__version__ = '1.3.0' | ||
__version__ = '1.4.0' | ||
VERSION = __version__ # synonym |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 4.0.6 on 2022-09-13 16:06 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('data', '0012_alter_datasettype_filename_pattern_and_more'), | ||
('jobs', '0007_remove_task_unique_task_name_per_session_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='task', | ||
name='data_repository', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='data.datarepository'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.urls import reverse | ||
from django.core.management import call_command | ||
|
||
from actions.models import Session | ||
from alyx.base import BaseTests | ||
from data.models import DataRepository | ||
|
||
|
||
class APISubjectsTests(BaseTests): | ||
|
||
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() | ||
self.session.task_protocol = 'ephys' | ||
self.session.save() | ||
self.dict_insertion = {'session': str(self.session.id), | ||
'name': 'probe_00', | ||
'model': '3A'} | ||
self.data_repository = DataRepository.objects.create(name='myrepo') | ||
|
||
def test_brain_regions_rest_filter(self): | ||
# test the custom filters get_descendants and get_ancestors | ||
task_dict = {'executable': 'exec', 'priority': 90, | ||
'io_charge': 40, 'gpu': 0, 'cpu': 1, | ||
'ram': 40, 'module': 'mod', 'parents': [], | ||
'level': 0, 'time_out_sec': 2, 'session': self.session.id, | ||
'status': 'Waiting', 'log': None, 'name': 'mytask', 'graph': 'mygraph', | ||
'arguments': {'titi': 'toto', 'tata': 'tutu'}, 'data_repository': 'myrepo'} | ||
rep = self.post(reverse('tasks-list'), task_dict) | ||
self.assertEqual(rep.status_code, 201) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters