Postgresql has referential integrety checking.
authorDiane Trout <diane@ghic.org>
Thu, 13 Feb 2014 01:27:30 +0000 (17:27 -0800)
committerDiane Trout <diane@ghic.org>
Tue, 10 Jun 2014 23:27:23 +0000 (16:27 -0700)
So some of my dangling foreign keys caused tests to failed.
I resolved them through a few different ways,
  * adding initial_data to include description tables
  * adding some additional data to the test fixture.
  * renumbering affiliation keys to match my small test list.

I had to reorder the app list because I think there was a dependency
in the wrong order.

htsworkflow/frontend/experiments/fixtures/test_flowcells.json
htsworkflow/frontend/inventory/fixtures/test_harddisks.json
htsworkflow/frontend/inventory/test_inventory.py
htsworkflow/frontend/samples/fixtures/test_samples.json
htsworkflow/settings.py

index a89d2c463a3a9de889eb892172050eb1b6ba54f7..15d00c60de68e10d233c95af20b6aa63f082b4c2 100644 (file)
             "library_type": 2,
             "made_by": "Lorian",
             "affiliations": [
-                41
+                3
             ],
             "replicate": 1,
             "condition": 1,
             "library_type": 1,
             "made_by": "Lorian",
             "affiliations": [
-                6
+                4
             ],
             "replicate": 1,
             "condition": null,
index f757fa8e55bf98e6be3d1d087cd4e41bcb553987..c9902609d7d73dc59218f49f2c80a88e613a722f 100644 (file)
@@ -1,4 +1,22 @@
 [
+ {"pk": 1,
+  "model": "bcmagic.printer",
+  "fields": {"name": "ZM400 1.25x1",
+             "label_height": 1.0,
+             "notes": "Everyday use labels",
+             "label_width": 1.25,
+             "label_shape": "Square",
+             "model": "Zebra ZM400",
+             "ip_address": "131.215.34.116"}},
+ {"pk": 2,
+  "model": "bcmagic.printer",
+  "fields": {"name": "ZM400 3x3",
+             "label_height": 3.0,
+             "notes": "Larger everyday use labels",
+             "label_width": 3.0,
+             "label_shape": "Square",
+             "model": "Zebra ZM400",
+             "ip_address": "131.215.34.117"}},
   { "model": "experiments.Sequencer",
     "pk": 7,
     "fields": {
index d7c2336b0866848ea49bc090e1cfbafbdbbc1fd4..2456ff30a4d06da181ed85d2d59aa9b41b8b931d 100644 (file)
@@ -16,7 +16,7 @@ def localhostNode(url):
     return RDF.Node(RDF.Uri('http://localhost%s' % (url,)))
 
 class InventoryTestCase(TestCase):
-    fixtures = ['test_user', 'test_harddisks']
+    fixtures = ['initial_data', 'test_user', 'test_harddisks']
 
     def test_fixture(self):
         # make sure that some of our test data is was loaded
index f368b71ff86b7c8b8d78829dbfe81f6e7938e0a8..41824e065a149215bfaf5d656cc2f23ae9576f94 100644 (file)
                  "email": "bob@some.where.else"
                }
     },
+    {"pk": 3, "model": "samples.affiliation",
+     "fields": {
+         "users": [],
+         "contact": "group 3",
+         "name": "affiliation 3",
+         "email": "pk3@example.com"
+         }
+     },
+    {"pk": 4, "model": "samples.affiliation",
+     "fields": {
+         "users": [],
+         "contact": "group 4",
+         "name": "affiliation 4",
+         "email": "pk1@example.com"
+         }
+     },
+    {"pk": 5, "model": "samples.affiliation",
+     "fields": {
+         "users": [],
+         "contact": "group 5",
+         "name": "affiliation 5",
+         "email": "pk5@example.com"
+         }
+     },
  {"pk": 153, "model": "experiments.flowcell",
   "fields": {
       "paired_end": true,
             "library_type": 2,
             "made_by": "Lorian",
             "affiliations": [
-                41
+                3
             ],
             "replicate": 1,
             "condition": 1,
             "library_type": 2,
             "made_by": "Brian Williams",
             "affiliations": [
-                4,
-                8,
-                12
+                1,
+                2,
+                4
             ],
             "replicate": 1,
             "condition": 1,
             "library_type": 2,
             "made_by": "Lorian",
             "affiliations": [
-                41
+                4
             ],
             "replicate": 1,
             "condition": 1,
             "library_type": 2,
             "made_by": "Lorian",
             "affiliations": [
-                41
+                4
             ],
             "replicate": 1,
             "condition": 1,
index 1952d1c93858b0eba5a3a1f136139f367cd81cf9..dce3d90c53608f876cf6b786604288513e96b972 100644 (file)
@@ -46,8 +46,8 @@ INSTALLED_APPS = (
     'htsworkflow.frontend.eland_config',
     'htsworkflow.frontend.samples',
     'htsworkflow.frontend.experiments',
-    'htsworkflow.frontend.inventory',
     'htsworkflow.frontend.bcmagic',
+    'htsworkflow.frontend.inventory',
     'htsworkflow.frontend.labels',
 )