From: Elliot Smith Date: Thu, 3 Sep 2015 00:25:11 +0000 (-0700) Subject: toaster: Fix test for projects page JSON X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66f965b68dda76a755d88879191a0f340ba19142;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toaster: Fix test for projects page JSON The tests expect data to be returned in a particular format, which doesn't include is_default or the num_builds fields added to support default project improvements. Add the extra fields so the tests pass again. [YOCTO #7932] Signed-off-by: Elliot Smith Signed-off-by: brian avery Signed-off-by: Richard Purdie --- diff --git a/lib/toaster/toastergui/tests.py b/lib/toaster/toastergui/tests.py index 85e27fe07c2..7acf4bc31d7 100644 --- a/lib/toaster/toastergui/tests.py +++ b/lib/toaster/toastergui/tests.py @@ -40,6 +40,7 @@ class ViewTests(TestCase): bitbake_version=bbv) self.project = Project.objects.create_project(name=PROJECT_NAME, release=release) + layersrc = LayerSource.objects.create(sourcetype=LayerSource.TYPE_IMPORTED) self.priority = ReleaseLayerSourcePriority.objects.create(release=release, layer_source=layersrc) @@ -86,10 +87,10 @@ class ViewTests(TestCase): self.assertEqual(sorted(data["rows"][0]), ['bitbake_version_id', 'created', 'id', - 'layersTypeAheadUrl', 'name', 'projectBuildsUrl', - 'projectPageUrl', 'recipesTypeAheadUrl', - 'release_id', 'short_description', 'updated', - 'user_id']) + 'is_default', 'layersTypeAheadUrl', 'name', + 'num_builds', 'projectBuildsUrl', 'projectPageUrl', + 'recipesTypeAheadUrl', 'release_id', + 'short_description', 'updated', 'user_id']) def test_typeaheads(self): """Test typeahead ReST API"""