Skip to content

Instantly share code, notes, and snippets.

@NetAngels
NetAngels / runner.py
Created Jun 24, 2011
Extremely fast Django test runner
View runner.py
# -*- coding: utf-8 -*-
"""
Extremely fast Django test runner, based on the idea that your database schema
and fixtures are changed much more seldom that your code and tests. All you
need is to make sure that your "quickstart.sqlite" database file is always up
to date.
BEWARE: Don't run this test runner on production server. It assumes that you
use only one database configured as "default", and its db engine is SQLite.
Otherwise your tests can eat your data!
@NetAngels
NetAngels / parse_csd.py
Created Feb 25, 2011
CSD parser decorator
View parse_csd.py
"""
Simplified decorator which is used to convert raw POST data in CSD (comma-separated dict) format to the list of dicts and then store this list as `request.csd` variable
For example, data like:
user=netangels,site=netangels.ru,hits=1234
user=example,site=example.com,hits=4567
stored in the file data.csd and sent by curl with a command like this: