code: def generate_content(self):
          
          # Setup pre-conditions.
          if not self.variance:
              logging.error("%s: No variance information %s", self.id(), self.variance)
              sys.exit(-1)
  
          for var in self.variable.values():
              var.clear()
  
          # Handle variances
          variances = []
          for _ in range(random.randint(DharmaConst.VARIANCE_MIN, DharmaConst.VARIANCE_MAX)):
              var = random.choice(list(self.variance.values()))
              variances.append(DharmaConst.VARIANCE_TEMPLATE % var.generate(GenState()))
              variances.append("\n")
  
          # Handle variables
          variables = []
          for var in self.variable.values():
              if var.default:
                  variables.append(DharmaConst.VARIANCE_TEMPLATE % var.default)
                  variables.append("\n")
  
          # Build content
          content = "".join(chain([self.prefix], variables, variances, [self.suffix]))
          if self.template:
              return Template(self.template).safe_substitute(testcase_content=content)
          return content
docs: Generates a test case as a string.