-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jtw/primevue-4
- Loading branch information
Showing
7 changed files
with
94 additions
and
34 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
18 changes: 18 additions & 0 deletions
18
arches_references/migrations/0004_require_controlledlistitem_uri.py
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,18 @@ | ||
# Generated by Django 4.2.14 on 2024-07-30 16:09 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("arches_references", "0003_add_node_index"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="listitem", | ||
name="uri", | ||
field=models.URLField(blank=True, max_length=2048), | ||
), | ||
] |
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 was deleted.
Oops, something went wrong.
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,19 @@ | ||
from django.test import TestCase | ||
|
||
from arches_references.models import ListItem | ||
|
||
# these tests can be run from the command line via | ||
# python manage.py test tests.test_models --settings="tests.test_settings" | ||
|
||
|
||
class ListItemTests(TestCase): | ||
def test_uri_generation_guards_against_failure(self): | ||
# Don't bother setting up a list. | ||
item = ListItem(sortorder=0) | ||
item.id = None | ||
|
||
with self.assertRaises(RuntimeError): | ||
item.clean() | ||
|
||
item.full_clean(exclude={"list"}) | ||
self.assertIsNotNone(item.uri) |
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