Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Package with new powerful TestCases and Assets to test django application fast. TDD is supported
Package with new powerful TestCases and Assets to test django application fast. TDD is supported
You can find Full Project Documentation here
The mission of the Django DRY Tests to design and develop open source python package to test django application
This is the open source project with MIT license. Be free to use, fork, clone and contribute.
Django==4
(Lower versions haven't been tested)pip install django-dry-tests
See more in Full Documentation
class QuickStartViewSimpleTestCase(SimpleTestCase):
"""
SimpleTestCase example
"""
def test_get(self):
"""
Test Example with django-dry-tests
:return:
"""
# Create Request Model
request = Request(
url='/quickstart/'
)
# Create Response Model to check all view.
# You can set only one param without others to check it.
true_response = TrueResponse(
status_code=200,
context=Context(
keys=['quickstart'], # check that quickstart key in context
values=['Quickstart'], # check that "Quickstart" value in context
items={
'quickstart': 'Quickstart'
}, # check both keys and values in context
types={
'quickstart': str
} # check values types without check values
),
content_values = [
'Quickstart',
'<h1>Quickstart title</h1>'
], # check values after template will be rendered
)
# get url response with Django default Test Client
current_response = request.get_response(self.client)
# Use main assert to run all asserts
self.assertTrueResponse(current_response, true_response)
class ExampleFromTestCase(SimpleTestCase):
"""
Example Form Test Class
"""
def test_form(self):
"""
Example Test with django-dry-tests
:return:
"""
true_form = TrueForm( # Set Up TrueForm instance
Fields( # TrueForm Fields
count=2, # check fields count
names=[
'number', 'name'
], # check field names
types={
'name': forms.CharField,
'number': forms.IntegerField
} # check fields types
),
)
current_form = ExampleForm() # Get project form
self.assertTrueForm(current_form, true_form) # use this main assert to check all conditions
You are welcome! To easy start please check:
FAQs
Package with new powerful TestCases and Assets to test django application fast. TDD is supported
We found that django-dry-tests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.