Skip to content

Incorrect tearDownClass Signature in Tests #650

@srijan2607

Description

@srijan2607

File: tests/__init__.py:174

Description: The tearDownClass method has an incorrect signature using self instead of cls.

@classmethod
def tearDownClass(self):  # BUG: Should be 'cls' not 'self'
    GeneralHoneypot.objects.all().delete()
    ...

Impact: Test cleanup may not work correctly, causing test data leakage between test runs.

Recommended Fix:

@classmethod
def tearDownClass(cls):
    GeneralHoneypot.objects.all().delete()
    IOC.objects.all().delete()
    CowrieSession.objects.all().delete()
    CommandSequence.objects.all().delete()
    Sensor.objects.all().delete()
    super().tearDownClass()

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpythonPull requests that update Python code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions