Skip to content
Snippets Groups Projects
Commit c6bcd5f5 authored by James Graham's avatar James Graham
Browse files

Fix failing PROV tests caused by invalid plugin name

parent c30ecd37
Branches
No related tags found
No related merge requests found
# Generated by Django 2.0.8 on 2019-02-19 10:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datasources', '0030_rename_licence'),
]
operations = [
migrations.AlterField(
model_name='datasource',
name='plugin_name',
field=models.CharField(default='DataSetConnector', max_length=63),
),
]
...@@ -239,6 +239,7 @@ class DataSource(BaseAppDataModel): ...@@ -239,6 +239,7 @@ class DataSource(BaseAppDataModel):
#: Name of plugin which allows interaction with this data source #: Name of plugin which allows interaction with this data source
plugin_name = models.CharField(max_length=MAX_LENGTH_NAME, plugin_name = models.CharField(max_length=MAX_LENGTH_NAME,
default='DataSetConnector',
blank=False, null=False) blank=False, null=False)
#: If the data source API requires an API key use this one #: If the data source API requires an API key use this one
......
...@@ -39,7 +39,6 @@ class ProvEntryTest(TestCase): ...@@ -39,7 +39,6 @@ class ProvEntryTest(TestCase):
name='Test Data Source', name='Test Data Source',
url='http://www.example.com', url='http://www.example.com',
owner=self.user, owner=self.user,
plugin_name='TEST'
) )
def tearDown(self): def tearDown(self):
...@@ -99,7 +98,6 @@ class ProvWrapperTest(TestCase): ...@@ -99,7 +98,6 @@ class ProvWrapperTest(TestCase):
name='Test Data Source', name='Test Data Source',
url='http://www.example.com', url='http://www.example.com',
owner=self.user, owner=self.user,
plugin_name='TEST'
) )
def tearDown(self): def tearDown(self):
...@@ -130,12 +128,24 @@ class ProvWrapperTest(TestCase): ...@@ -130,12 +128,24 @@ class ProvWrapperTest(TestCase):
""" """
n_provs = self._count_prov(self.datasource) n_provs = self._count_prov(self.datasource)
self.datasource.plugin_name = 'CHANGED' self.datasource.api_key = 'TEST'
self.datasource.save() self.datasource.save()
# Another PROV record should be created when model is changed and saved # Another PROV record should be created when model is changed and saved
self.assertEqual(self._count_prov(self.datasource), n_provs + 1) self.assertEqual(self._count_prov(self.datasource), n_provs + 1)
@unittest.expectedFailure
def test_prov_datasource_no_update(self):
"""
Test that a new :class:`ProvEntry` is not created when a model is saved without changes.
"""
n_provs = self._count_prov(self.datasource)
self.datasource.save()
# Another PROV record should be created when model is changed and saved
self.assertEqual(self._count_prov(self.datasource), n_provs)
@unittest.expectedFailure @unittest.expectedFailure
def test_prov_datasource_null_update(self): def test_prov_datasource_null_update(self):
""" """
...@@ -158,7 +168,6 @@ class ProvWrapperTest(TestCase): ...@@ -158,7 +168,6 @@ class ProvWrapperTest(TestCase):
name='Another Test Data Source', name='Another Test Data Source',
url='http://www.example.com', url='http://www.example.com',
owner=self.user, owner=self.user,
plugin_name='TEST'
) )
new_prov_entries = models.ProvWrapper.filter_model_instance(new_datasource) new_prov_entries = models.ProvWrapper.filter_model_instance(new_datasource)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment