How to Delete Tests

170 views
Skip to first unread message

Dhrumil

unread,
May 19, 2021, 9:16:28 AM5/19/21
to QATrack+
Hello, I created some tests for a new testlist that ended up not being needed. However I am unable to now delete these tests, is there a way to do this? I am not worried about losing any data since this is new tests.

Thank you for your time, 

Dhrumil 
Screen Shot 2021-05-19 at 9.10.34 AM.png
Screen Shot 2021-05-19 at 9.10.59 AM.png
Screen Shot 2021-05-19 at 9.08.09 AM.png

Randle Taylor

unread,
May 19, 2021, 9:29:53 AM5/19/21
to Dhrumil, QATrack+
You would currently need to delete those UnitTestInfoChange through a Python shell before you could delete the UnitTestInfo objects, and then finally the test.

Activate your virtualenv then:

python manage.py shell_plus

uti = UnitTestInfo.object.get(id=1605)  # double check your ID
uti.unittestinfochange_set.all().delete()
uti.delete()
exit

Now you can delete your test through the admin.

Unfortunately this is quite cumbersome at the moment because we have tried to be careful with preventing people from accidentally deleting data.  That said, I think we should change it so that deleting a UnitTestInfo object cascades and deletes the associated UnitTestInfoChange objects as well.   I'll file an issue for this.

Randy

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/10c82751-062a-419e-b9c8-29482bcfe497n%40googlegroups.com.

Dhrumil

unread,
May 19, 2021, 10:05:53 AM5/19/21
to QATrack+
Yes okay, thank you for your time Randy!

Lydia Westhead

unread,
Aug 29, 2023, 4:35:29 AM8/29/23
to QATrack+
Hello, I'm having a similar problem to this now.

I created two versions of a test and only want to keep one. However, it takes me through a series of cannot delete objects until the message in the picture below:

I'm not familiar with the virtualenv python shell mentioned in your response above. Is there another way to locate this UnitTestInfoChange object (15) which is blocking this?

Many thanks,
Lydia
Screenshot 2023-08-29 093321.png

Randle Taylor

unread,
Aug 30, 2023, 12:33:52 PM8/30/23
to Lydia Westhead, QATrack+
Unfortunately the only workaround right now is to use the command line to delete things.  it's going to require a new release to resolve the issue with the user interface.

Randy

Lydia Westhead

unread,
Sep 6, 2023, 10:04:29 AM9/6/23
to QATrack+
Okay, thank you for letting me know. I will try not to repeat making a dummy test then.

Lydia

Reply all
Reply to author
Forward
0 new messages