Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
rest-framework-smoke
Advanced tools
Smoke tests for API built with Django Rest Framework.
pip install rest-framework-smoke
Full example located at testproject.testapp.tests
from rest_framework.test import APITestCase
from rest_framework_smoke.tests.mixins import ReadOnlyViewSetTestsMixin
from rest_framework_smoke.tests.schemas import get_object_schema
from testproject.testapp import models
TASK_SCHEMA = {
"id": {"type": ["number"]},
"name": {"type": ["string"]},
}
PROJECT_SCHEMA = {
"id": {"type": ["number"]},
"name": {"type": ["string"]},
"task_set": {
"type": ["array"],
"minItems": 1,
"items": get_object_schema(TASK_SCHEMA)
}
}
class ProjectViewSetTestCase(ReadOnlyViewSetTestsMixin, APITestCase):
object_name = 'project'
basename = 'projects'
schema = details_schema = PROJECT_SCHEMA
pagination_schema = None
@classmethod
def setUpTestData(cls):
cls.project = models.Project.objects.create(name='project')
cls.task = models.Task.objects.create(name='task', project=cls.project)
Happy API testing :)
Rest-Framework-Smoke uses jsonschema
to validate API response format.
When we check format, we should pay attention to:
So there are two helpers in rest_framework_smoke.tests.schemas
to enforce
these constraints (and they are used internally for format tests):
get_object_schema
get_array_schema
FAQs
Smoke tests for API built with Django Rest Framework
We found that rest-framework-smoke demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.