コード例 #1
0
 def test(self):
     self.domain = 'alskdjfablasdkffsdlkfjabas'
     project = create_domain(name=self.domain)
     app = Application(domain=self.domain, version=4)
     app.save()
     app_id = app.get_id
     build = Application(domain=self.domain, version=3)
     build.copy_of = app_id
     build.save()
     build_id = build.get_id
     cache.clear()
     try:
         self._test(build_id, app_id, build_id)
         self._test(app_id, app_id, None)
         self._test('alskdjflaksdjf', 'alskdjflaksdjf', None)
         app.delete_app()
         # does this work just as well for a deleted app?
         cache.clear()
         self._test(build_id, app_id, build_id)
         build.delete_app()
         cache.clear()
         form = self._test(build_id, app_id, build_id)
         self._test_app_version(self.domain, form, build)
         # (test cache hit)
         self._test_app_version(self.domain, form, build)
     finally:
         project.delete()