def METHOD_NAME(self):
    # create a project with a form
    self._publish_xls_form_to_project()
    project = Project.objects.last()
    form = project.xform_set.last()
    request = self.factory.get('/', **self.extra)
    request.user = self.user
    serializer = ProjectSerializer(project)
    serializer.context['request'] = request
    self.assertEqual(len(serializer.data['forms']), 1)
    self.assertEqual(serializer.data['forms'][0]['encrypted'], False)
    self.assertEqual(serializer.data['num_datasets'], 1)
    # delete form in project
    form.delete()
    # Check that project has no forms
    self.assertIsNone(project.xform_set.last())
    serializer = ProjectSerializer(project, context={'request': request})
    self.assertEqual(len(serializer.data['forms']), 0)
    self.assertEqual(serializer.data['num_datasets'], 0)