From 343f2076d16b2d71605bc8d2d285b40c0653fe2c Mon Sep 17 00:00:00 2001 From: Justin Littman Date: Wed, 30 Nov 2016 11:30:44 -0500 Subject: [PATCH] Fix to serialize unit test. --- sfm/ui/test_serialize.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sfm/ui/test_serialize.py b/sfm/ui/test_serialize.py index 6714a7e1..849afb26 100644 --- a/sfm/ui/test_serialize.py +++ b/sfm/ui/test_serialize.py @@ -387,15 +387,16 @@ def test_serialize_by_collection(self): self.credential3.delete() # This is also deleting credential1's history Credential.history.all().delete() - self.collection_set.delete() - self.group2.delete() - # Note that group1 still exists. - self.assertEqual(1, Group.objects.count()) + # self.group2.delete() + # Note that group1 and group2 still exists. + self.assertEqual(2, Group.objects.count()) # Note that user1 still exists self.user2.delete() self.assertEqual(1, User.objects.count()) self.assertEqual(1, Credential.objects.count()) # Note that collection set still exists + self.assertEqual(1, CollectionSet.objects.count()) + self.assertEqual(2, CollectionSet.history.count()) # Now deserialize again deserializer.deserialize_collection(self.collection2_path) @@ -426,7 +427,7 @@ def test_serialize_by_collection(self): for h_collection in Collection.objects.get(collection_id=self.collection1.collection_id).history.all(): self.assertEqual("test_collection1", h_collection.name) - self.assertEqual(3, CollectionSet.objects.get( + self.assertEqual(2, CollectionSet.objects.get( collection_set_id=self.collection_set.collection_set_id).history.count()) self.assertEqual(2, Credential.objects.get(credential_id=self.credential2.credential_id).history.count()) # Make sure we got the right historical objects