tcms.core.helpers.comments module

Functions that help access comments of objects.

tcms.core.helpers.comments.add_comment(objs, comments, user, submit_date=None)[source]

Add django.comment for an object.

Parameters:
  • objs (list) – List of object to which to add comments
  • comments (str) – The commentary
  • user (A User model) – Who is adding this
  • submit_date (datetime.datetime) – A time stamp

Example:

from django.contrib.auth.models import User
testuser = User.objects.get(email='user@example.com')
from tcms.testruns.models import TestCaseRun
testrun = TestCaseRun.objects.get(pk=171675)
comments = 'stupid comments by Homer'
add_comment([testrun,], comments, testuser)