summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-07-21 14:43:28 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-26 08:10:36 +0100
commitbb260e94a63d6d498c9c76b862bc836a90678495 (patch)
tree9fe719213c79a999e5d5eb7e4c28da926c56db6f /bitbake/lib
parentef627d0ab8f5cf2fc72005393e76047cb623ff3d (diff)
downloadpoky-bb260e94a63d6d498c9c76b862bc836a90678495.tar.gz
bitbake: toaster: tests: Remove references to LayerSource model
Remove and replace layersource model references in the tests and test data. Remove the orm/test as this only tested LayerSource interactions which have now been removed. (Bitbake rev: 61a47cbc92c856690cb0e8da7102b2e669eaee0a) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py18
-rw-r--r--bitbake/lib/toaster/orm/tests.py180
-rw-r--r--bitbake/lib/toaster/tests/browser/test_layerdetails_page.py2
-rw-r--r--bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml39
-rw-r--r--bitbake/lib/toaster/toastergui/tests.py3
5 files changed, 2 insertions, 240 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
index 6f08f1db80..1f57fc16f1 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
@@ -9,24 +9,6 @@ from .checksettings import DN
9import logging 9import logging
10logger = logging.getLogger("toaster") 10logger = logging.getLogger("toaster")
11 11
12def _reduce_canon_path(path):
13 components = []
14 for c in path.split("/"):
15 if c == "..":
16 del components[-1]
17 elif c == ".":
18 pass
19 else:
20 components.append(c)
21 if len(components) < 2:
22 components.append('')
23 return "/".join(components)
24
25def _get_id_for_sourcetype(s):
26 for i in LayerSource.SOURCE_TYPE:
27 if s == i[1]:
28 return i[0]
29 raise Exception("Could not find definition for sourcetype '%s'. Valid source types are %s" % (str(s), ', '.join(map(lambda x: "'%s'" % x[1], LayerSource.SOURCE_TYPE ))))
30 12
31class Command(BaseCommand): 13class Command(BaseCommand):
32 help = "Loads a toasterconf.json file in the database" 14 help = "Loads a toasterconf.json file in the database"
diff --git a/bitbake/lib/toaster/orm/tests.py b/bitbake/lib/toaster/orm/tests.py
deleted file mode 100644
index 719266e6d6..0000000000
--- a/bitbake/lib/toaster/orm/tests.py
+++ /dev/null
@@ -1,180 +0,0 @@
1#! /usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# BitBake Toaster Implementation
6#
7# Copyright (C) 2013-2015 Intel Corporation
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License version 2 as
11# published by the Free Software Foundation.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License along
19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22"""Test cases for Toaster ORM."""
23
24from django.test import TestCase, TransactionTestCase
25from orm.models import LocalLayerSource, LayerIndexLayerSource, ImportedLayerSource, LayerSource
26from orm.models import Branch, LayerVersionDependency
27
28from orm.models import Project, Layer, Layer_Version, Branch, ProjectLayer
29from orm.models import Release, ReleaseLayerSourcePriority, BitbakeVersion
30
31from django.db import IntegrityError
32
33import os
34
35# set TTS_LAYER_INDEX to the base url to use a different instance of the layer index
36
37class LayerSourceVerifyInheritanceSaveLoad(TestCase):
38 """
39 Tests to verify inheritance for the LayerSource proxy-inheritance classes.
40 """
41 def test_object_creation(self):
42 """Test LayerSource object creation."""
43 for name, sourcetype in [("a1", LayerSource.TYPE_LOCAL),
44 ("a2", LayerSource.TYPE_LAYERINDEX),
45 ("a3", LayerSource.TYPE_IMPORTED)]:
46 LayerSource.objects.create(name=name, sourcetype=sourcetype)
47
48 objects = LayerSource.objects.all()
49 self.assertTrue(isinstance(objects[0], LocalLayerSource))
50 self.assertTrue(isinstance(objects[1], LayerIndexLayerSource))
51 self.assertTrue(isinstance(objects[2], ImportedLayerSource))
52
53 def test_duplicate_error(self):
54 """Test creation of duplicate LayerSource objects."""
55 stype = LayerSource.TYPE_LOCAL
56 LayerSource.objects.create(name="a1", sourcetype=stype)
57 with self.assertRaises(IntegrityError):
58 LayerSource.objects.create(name="a1", sourcetype=stype)
59
60
61class LILSUpdateTestCase(TransactionTestCase):
62 """Test Layer Source update."""
63
64 def setUp(self):
65 """Create release."""
66 bbv = BitbakeVersion.objects.create(\
67 name="master", giturl="git://git.openembedded.org/bitbake")
68 Release.objects.create(name="default-release", bitbake_version=bbv,
69 branch_name="master")
70
71 def test_update(self):
72 """Check if LayerSource.update can fetch branches."""
73 url = os.getenv("TTS_LAYER_INDEX",
74 default="http://layers.openembedded.org/")
75
76 lsobj = LayerSource.objects.create(\
77 name="b1", sourcetype=LayerSource.TYPE_LAYERINDEX,
78 apiurl=url + "layerindex/api/")
79 lsobj.update()
80 self.assertTrue(lsobj.branch_set.all().count() > 0,
81 "no branches fetched")
82
83class LayerVersionEquivalenceTestCase(TestCase):
84 """Verify Layer_Version priority selection."""
85
86 def setUp(self):
87 """Create required objects."""
88 # create layer source
89 self.lsrc = LayerSource.objects.create(name="dummy-layersource",
90 sourcetype=LayerSource.TYPE_LOCAL)
91 # create release
92 bbv = BitbakeVersion.objects.create(\
93 name="master", giturl="git://git.openembedded.org/bitbake")
94 self.release = Release.objects.create(name="default-release",
95 bitbake_version=bbv,
96 branch_name="master")
97 # attach layer source to release
98 ReleaseLayerSourcePriority.objects.create(\
99 release=self.release, layer_source=self.lsrc, priority=1)
100
101 # create a layer version for the layer on the specified branch
102 self.layer = Layer.objects.create(name="meta-testlayer",
103 layer_source=self.lsrc)
104 self.branch = Branch.objects.create(name="master", layer_source=self.lsrc)
105 self.lver = Layer_Version.objects.create(\
106 layer=self.layer, layer_source=self.lsrc, up_branch=self.branch)
107
108 # create project and project layer
109 self.project = Project.objects.create_project(name="test-project",
110 release=self.release)
111 ProjectLayer.objects.create(project=self.project,
112 layercommit=self.lver)
113
114 # create spoof layer that should not appear in the search results
115 layer = Layer.objects.create(name="meta-notvalid",
116 layer_source=self.lsrc)
117 self.lver2 = Layer_Version.objects.create(layer=layer,
118 layer_source=self.lsrc,
119 up_branch=self.branch)
120
121 def test_single_layersource(self):
122 """
123 When we have a single layer version,
124 get_equivalents_wpriority() should return a list with
125 just this layer_version.
126 """
127 equivqs = self.lver.get_equivalents_wpriority(self.project)
128 self.assertEqual(list(equivqs), [self.lver])
129
130 def test_dual_layersource(self):
131 """
132 If we have two layers with the same name, from different layer sources,
133 we expect both layers in, in increasing priority of the layer source.
134 """
135 lsrc2 = LayerSource.objects.create(\
136 name="dummy-layersource2",
137 sourcetype=LayerSource.TYPE_LOCAL,
138 apiurl="test")
139
140 # assign a lower priority for the second layer source
141 self.release.releaselayersourcepriority_set.create(layer_source=lsrc2,
142 priority=2)
143
144 # create a new layer_version for a layer with the same name
145 # coming from the second layer source
146 layer2 = Layer.objects.create(name="meta-testlayer",
147 layer_source=lsrc2)
148 lver2 = Layer_Version.objects.create(layer=layer2, layer_source=lsrc2,
149 up_branch=self.branch)
150
151 # expect two layer versions, in the priority order
152 equivqs = self.lver.get_equivalents_wpriority(self.project)
153 self.assertEqual(list(equivqs), [lver2, self.lver])
154
155 def test_compatible_layer_versions(self):
156 """
157 When we have a 2 layer versions, get_all_compatible_layerversions()
158 should return a queryset with both.
159 """
160 compat_lv = self.project.get_all_compatible_layer_versions()
161 self.assertEqual(list(compat_lv), [self.lver, self.lver2])
162
163 def test_layerversion_get_alldeps(self):
164 """Test Layer_Version.get_alldeps API."""
165 lvers = {}
166 for i in range(10):
167 name = "layer%d" % i
168 lvers[name] = Layer_Version.objects.create(layer=Layer.objects.create(name=name),
169 project=self.project)
170 if i:
171 LayerVersionDependency.objects.create(layer_version=lvers["layer%d" % (i - 1)],
172 depends_on=lvers[name])
173 # Check dinamically added deps
174 self.assertEqual(lvers['layer0'].get_alldeps(self.project.id),
175 [lvers['layer%d' % n] for n in range(1, i+1)])
176
177 # Check chain of deps created in previous loop
178 for i in range(10):
179 self.assertEqual(lvers['layer%d' % i].get_alldeps(self.project.id),
180 [lvers['layer%d' % n] for n in range(i+1, 10)])
diff --git a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
index 71c5c12d18..0005192b15 100644
--- a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -63,7 +63,7 @@ class TestLayerDetailsPage(SeleniumTestCase):
63 63
64 self.imported_layer_version = Layer_Version.objects.create( 64 self.imported_layer_version = Layer_Version.objects.create(
65 layer=imported_layer, 65 layer=imported_layer,
66 layer_source=layer_source, 66 layer_source=LayerSource.TYPE_IMPORTED,
67 branch=gitrev, 67 branch=gitrev,
68 commit=gitrev, 68 commit=gitrev,
69 dirpath=subdir, 69 dirpath=subdir,
diff --git a/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml b/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
index 213bf0f675..80c1e19dda 100644
--- a/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
+++ b/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
@@ -195,8 +195,6 @@
195 <field to="orm.customimagerecipe" name="recipe_appends" rel="ManyToManyRel"><object pk="3"></object></field> 195 <field to="orm.customimagerecipe" name="recipe_appends" rel="ManyToManyRel"><object pk="3"></object></field>
196 </object> 196 </object>
197 <object pk="1" model="orm.recipe"> 197 <object pk="1" model="orm.recipe">
198 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
199 <field type="IntegerField" name="up_id"><None></None></field>
200 <field type="DateTimeField" name="up_date"><None></None></field> 198 <field type="DateTimeField" name="up_date"><None></None></field>
201 <field type="CharField" name="name">z recipe</field> 199 <field type="CharField" name="name">z recipe</field>
202 <field type="CharField" name="version">5.2</field> 200 <field type="CharField" name="version">5.2</field>
@@ -212,8 +210,6 @@
212 <field type="BooleanField" name="is_image">False</field> 210 <field type="BooleanField" name="is_image">False</field>
213 </object> 211 </object>
214 <object pk="2" model="orm.recipe"> 212 <object pk="2" model="orm.recipe">
215 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
216 <field type="IntegerField" name="up_id"><None></None></field>
217 <field type="DateTimeField" name="up_date"><None></None></field> 213 <field type="DateTimeField" name="up_date"><None></None></field>
218 <field type="CharField" name="name">a recipe</field> 214 <field type="CharField" name="name">a recipe</field>
219 <field type="CharField" name="version">1.2</field> 215 <field type="CharField" name="version">1.2</field>
@@ -229,8 +225,6 @@
229 <field type="BooleanField" name="is_image">False</field> 225 <field type="BooleanField" name="is_image">False</field>
230 </object> 226 </object>
231 <object pk="3" model="orm.recipe"> 227 <object pk="3" model="orm.recipe">
232 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
233 <field type="IntegerField" name="up_id"><None></None></field>
234 <field type="DateTimeField" name="up_date"><None></None></field> 228 <field type="DateTimeField" name="up_date"><None></None></field>
235 <field type="CharField" name="name">a custom recipe</field> 229 <field type="CharField" name="name">a custom recipe</field>
236 <field type="CharField" name="version"></field> 230 <field type="CharField" name="version"></field>
@@ -246,8 +240,6 @@
246 <field type="BooleanField" name="is_image">False</field> 240 <field type="BooleanField" name="is_image">False</field>
247 </object> 241 </object>
248 <object pk="4" model="orm.recipe"> 242 <object pk="4" model="orm.recipe">
249 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
250 <field type="IntegerField" name="up_id"><None></None></field>
251 <field type="DateTimeField" name="up_date"><None></None></field> 243 <field type="DateTimeField" name="up_date"><None></None></field>
252 <field type="CharField" name="name">a image recipe</field> 244 <field type="CharField" name="name">a image recipe</field>
253 <field type="CharField" name="version">1.2</field> 245 <field type="CharField" name="version">1.2</field>
@@ -263,8 +255,6 @@
263 <field type="BooleanField" name="is_image">True</field> 255 <field type="BooleanField" name="is_image">True</field>
264 </object> 256 </object>
265 <object pk="5" model="orm.recipe"> 257 <object pk="5" model="orm.recipe">
266 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
267 <field type="IntegerField" name="up_id"><None></None></field>
268 <field type="DateTimeField" name="up_date"><None></None></field> 258 <field type="DateTimeField" name="up_date"><None></None></field>
269 <field type="CharField" name="name">z image recipe</field> 259 <field type="CharField" name="name">z image recipe</field>
270 <field type="CharField" name="version">1.3</field> 260 <field type="CharField" name="version">1.3</field>
@@ -280,8 +270,6 @@
280 <field type="BooleanField" name="is_image">True</field> 270 <field type="BooleanField" name="is_image">True</field>
281 </object> 271 </object>
282 <object pk="6" model="orm.recipe"> 272 <object pk="6" model="orm.recipe">
283 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
284 <field type="IntegerField" name="up_id"><None></None></field>
285 <field type="DateTimeField" name="up_date"><None></None></field> 273 <field type="DateTimeField" name="up_date"><None></None></field>
286 <field type="CharField" name="name">z custom recipe</field> 274 <field type="CharField" name="name">z custom recipe</field>
287 <field type="CharField" name="version"></field> 275 <field type="CharField" name="version"></field>
@@ -307,34 +295,23 @@
307 </object> 295 </object>
308 296
309 <object pk="1" model="orm.machine"> 297 <object pk="1" model="orm.machine">
310 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
311 <field type="IntegerField" name="up_id"><None></None></field>
312 <field type="DateTimeField" name="up_date"><None></None></field> 298 <field type="DateTimeField" name="up_date"><None></None></field>
313 <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field> 299 <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
314 <field type="CharField" name="name">a machine</field> 300 <field type="CharField" name="name">a machine</field>
315 <field type="CharField" name="description">a machine</field> 301 <field type="CharField" name="description">a machine</field>
316 </object> 302 </object>
317 <object pk="2" model="orm.machine"> 303 <object pk="2" model="orm.machine">
318 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
319 <field type="IntegerField" name="up_id"><None></None></field>
320 <field type="DateTimeField" name="up_date"><None></None></field> 304 <field type="DateTimeField" name="up_date"><None></None></field>
321 <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field> 305 <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
322 <field type="CharField" name="name">z machine</field> 306 <field type="CharField" name="name">z machine</field>
323 <field type="CharField" name="description">z machine</field> 307 <field type="CharField" name="description">z machine</field>
324 </object> 308 </object>
325 <object pk="3" model="orm.machine"> 309 <object pk="3" model="orm.machine">
326 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
327 <field type="IntegerField" name="up_id"><None></None></field>
328 <field type="DateTimeField" name="up_date"><None></None></field> 310 <field type="DateTimeField" name="up_date"><None></None></field>
329 <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field> 311 <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
330 <field type="CharField" name="name">g machine</field> 312 <field type="CharField" name="name">g machine</field>
331 <field type="CharField" name="description">g machine</field> 313 <field type="CharField" name="description">g machine</field>
332 </object> 314 </object>
333 <object pk="1" model="orm.layersource">
334 <field type="CharField" name="name">local</field>
335 <field type="IntegerField" name="sourcetype">1</field>
336 <field type="CharField" name="apiurl"></field>
337 </object>
338 <object pk="1" model="orm.bitbakeversion"> 315 <object pk="1" model="orm.bitbakeversion">
339 <field type="CharField" name="name">test bbv</field> 316 <field type="CharField" name="name">test bbv</field>
340 <field type="CharField" name="giturl">/tmp/</field> 317 <field type="CharField" name="giturl">/tmp/</field>
@@ -355,26 +332,16 @@
355 <field type="CharField" name="branch_name">master</field> 332 <field type="CharField" name="branch_name">master</field>
356 <field type="TextField" name="helptext"><None></None></field> 333 <field type="TextField" name="helptext"><None></None></field>
357 </object> 334 </object>
358 <object pk="1" model="orm.releaselayersourcepriority">
359 <field to="orm.release" name="release" rel="ManyToOneRel">1</field>
360 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
361 <field type="IntegerField" name="priority">0</field>
362 </object>
363 <object pk="1" model="orm.branch"> 335 <object pk="1" model="orm.branch">
364 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
365 <field type="CharField" name="name">master</field> 336 <field type="CharField" name="name">master</field>
366 <field type="CharField" name="short_description"></field> 337 <field type="CharField" name="short_description"></field>
367 </object> 338 </object>
368 <object pk="1" model="orm.layer"> 339 <object pk="1" model="orm.layer">
369 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
370 <field type="IntegerField" name="up_id"><None></None></field>
371 <field type="DateTimeField" name="up_date"><None></None></field> 340 <field type="DateTimeField" name="up_date"><None></None></field>
372 <field type="CharField" name="name">a layer</field> 341 <field type="CharField" name="name">a layer</field>
373 <field type="CharField" name="vcs_url">/tmp/</field> 342 <field type="CharField" name="vcs_url">/tmp/</field>
374 </object> 343 </object>
375 <object pk="2" model="orm.layer"> 344 <object pk="2" model="orm.layer">
376 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
377 <field type="IntegerField" name="up_id"><None></None></field>
378 <field type="DateTimeField" name="up_date"><None></None></field> 345 <field type="DateTimeField" name="up_date"><None></None></field>
379 <field type="CharField" name="name">z layer</field> 346 <field type="CharField" name="name">z layer</field>
380 <field type="CharField" name="layer_index_url"></field> 347 <field type="CharField" name="layer_index_url"></field>
@@ -383,8 +350,6 @@
383 <object pk="1" model="orm.layer_version"> 350 <object pk="1" model="orm.layer_version">
384 <field to="orm.build" name="build" rel="ManyToOneRel">1</field> 351 <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
385 <field to="orm.layer" name="layer" rel="ManyToOneRel">1</field> 352 <field to="orm.layer" name="layer" rel="ManyToOneRel">1</field>
386 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
387 <field type="IntegerField" name="up_id"><None></None></field>
388 <field type="DateTimeField" name="up_date"><None></None></field> 353 <field type="DateTimeField" name="up_date"><None></None></field>
389 <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field> 354 <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
390 <field type="CharField" name="branch">master</field> 355 <field type="CharField" name="branch">master</field>
@@ -397,8 +362,6 @@
397 <object pk="2" model="orm.layer_version"> 362 <object pk="2" model="orm.layer_version">
398 <field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field> 363 <field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field>
399 <field to="orm.layer" name="layer" rel="ManyToOneRel">2</field> 364 <field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
400 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
401 <field type="IntegerField" name="up_id"><None></None></field>
402 <field type="DateTimeField" name="up_date"><None></None></field> 365 <field type="DateTimeField" name="up_date"><None></None></field>
403 <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field> 366 <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
404 <field type="CharField" name="branch">testing-branch</field> 367 <field type="CharField" name="branch">testing-branch</field>
@@ -411,8 +374,6 @@
411 <object pk="3" model="orm.layer_version"> 374 <object pk="3" model="orm.layer_version">
412 <field to="orm.build" name="build" rel="ManyToOneRel">1</field> 375 <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
413 <field to="orm.layer" name="layer" rel="ManyToOneRel">2</field> 376 <field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
414 <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
415 <field type="IntegerField" name="up_id"><None></None></field>
416 <field type="DateTimeField" name="up_date"><None></None></field> 377 <field type="DateTimeField" name="up_date"><None></None></field>
417 <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field> 378 <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
418 <field type="CharField" name="branch">testing-branch</field> 379 <field type="CharField" name="branch">testing-branch</field>
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py
index da530a10e5..03b73a9d69 100644
--- a/bitbake/lib/toaster/toastergui/tests.py
+++ b/bitbake/lib/toaster/toastergui/tests.py
@@ -28,7 +28,7 @@ from django.utils import timezone
28from django.db.models import Q 28from django.db.models import Q
29 29
30from orm.models import Project, Release, BitbakeVersion, Package, LogMessage 30from orm.models import Project, Release, BitbakeVersion, Package, LogMessage
31from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build 31from orm.models import LayerSource, Layer, Build
32from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target 32from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target
33from orm.models import CustomImageRecipe, ProjectVariable 33from orm.models import CustomImageRecipe, ProjectVariable
34from orm.models import Branch, CustomImagePackage 34from orm.models import Branch, CustomImagePackage
@@ -149,7 +149,6 @@ class ViewTests(TestCase):
149 149
150 def test_xhr_import_layer(self): 150 def test_xhr_import_layer(self):
151 """Test xhr_importlayer API""" 151 """Test xhr_importlayer API"""
152 LayerSource.objects.create(sourcetype=LayerSource.TYPE_IMPORTED)
153 #Test for importing an already existing layer 152 #Test for importing an already existing layer
154 args = {'vcs_url' : "git://git.example.com/test", 153 args = {'vcs_url' : "git://git.example.com/test",
155 'name' : "base-layer", 154 'name' : "base-layer",