Fix deletion of labels and add tests
This commit is contained in:
parent
b3c592c09a
commit
1a2666be07
4 changed files with 151 additions and 105 deletions
|
@ -1768,6 +1768,8 @@ class TestDeleteRepository(ApiTestCase):
|
|||
date=datetime.datetime.now() - datetime.timedelta(days=5), count=6)
|
||||
|
||||
# Create some labels.
|
||||
pre_delete_label_count = database.Label.select().count()
|
||||
|
||||
tag_manifest = model.tag.load_tag_manifest(ADMIN_ACCESS_USER, 'complex', 'prod')
|
||||
model.label.create_manifest_label(tag_manifest, 'foo', 'bar', 'manifest')
|
||||
model.label.create_manifest_label(tag_manifest, 'foo', 'baz', 'manifest')
|
||||
|
@ -1785,6 +1787,10 @@ class TestDeleteRepository(ApiTestCase):
|
|||
params=dict(repository=self.COMPLEX_REPO),
|
||||
expected_code=404)
|
||||
|
||||
# Verify the labels are gone.
|
||||
post_delete_label_count = database.Label.select().count()
|
||||
self.assertEquals(post_delete_label_count, pre_delete_label_count)
|
||||
|
||||
|
||||
class TestGetRepository(ApiTestCase):
|
||||
PUBLIC_REPO = PUBLIC_USER + '/publicrepo'
|
||||
|
|
Reference in a new issue