app.published_json is not updated when an app is deleted

Bug #1221325 reported by Vincent Ladeuil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Software Center Agent
Confirmed
Undecided
Matias Bordese

Bug Description

This came up while writing devportal.tests.test_clickapp_user_stories.ClickUserStoriesInvolvingClickPackageIndex.test_delete_app:

    def test_delete_app(self):
        app = self.factory.makeClickPackage(registrant=self.developer._user,
                                            state="Published")
        # Make sure we have the right app in click-package-index
        app.update_click_index()
        resp = self.developer.application_delete(app, data=dict(confirm=True))
        # A narrower check would be better
        self.assertEqual(200, resp.status_code)
        # Since we don't use USE_CLICK_UPDOWN_STATUS_API we succeed to delete
        # the app.
        self.assertContains(resp,
                            'Your application has been permanently deleted.')
        refreshed = get_refreshed_app_json(app)
        # The json part is not updated and as such still mentions 'Published'
        self.assertEqual('Published', refreshed['status'])
        # But the model rightly sees the deletion
        refreshed_app = models.ClickPackage.objects.get(pk=app.id)
        self.assertEqual('Deleted', refreshed_app._state_token)

Tags: by-qa in-dev
Vincent Ladeuil (vila)
Changed in software-center-agent:
status: New → Confirmed
assignee: nobody → Vincent Ladeuil (vila)
assignee: Vincent Ladeuil (vila) → Matias Bordese (matiasb)
tags: added: by-qa in-dev
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.