Skip to content

Commit

Permalink
rename TestModelWithCustomRevisionMetaInfo as TestModelWithCustomOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Oct 4, 2013
1 parent 98c7c06 commit fa6084a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ BUILDDIR='~build'
DJANGO_SETTINGS_MODULE:=demoproject.settings
PYTHONPATH := ${PWD}/demo/:${PWD}
PIP=${VIRTUAL_ENV}/bin/pip
DJANGO_14=django==1.4.8
DJANGO_15=django==1.5.4
DJANGO_16=https://www.djangoproject.com/m/releases/1.6/Django-1.6b4.tar.gz
DJANGO_DEV=git+git://github.com/django/django.git

mkbuilddir:
mkdir -p ${BUILDDIR}
Expand All @@ -24,13 +28,22 @@ test:
demo/manage.py test concurrency --settings=${DJANGO_SETTINGS_MODULE}


init-db:
sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS concurrency;'; fi"
sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -c 'DROP DATABASE IF EXISTS concurrency;' -U postgres; fi"

sh -c "if [ '${DBENGINE}' = 'mysql' ]; then pip install MySQL-python; fi"
sh -c "if [ '${DBENGINE}' = 'pg' ]; then pip install -q psycopg2; fi"

sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS concurrency;'; fi"
sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -c 'CREATE DATABASE concurrency;' -U postgres; fi"

ci:
@[ "${DJANGO}" = "1.4.x" ] && pip install django==1.4.8 || :
@[ "${DJANGO}" = "1.5.x" ] && pip install django==1.5.4 || :
@[ "${DJANGO}" = "1.6.x" ] && pip install https://www.djangoproject.com/m/releases/1.6/Django-1.6b4.tar.gz || :
@[ "${DJANGO}" = "dev" ] && pip install git+git://github.com/django/django.git || :
sh -c "if [ '${DJANGO}' = '1.4.x' ]; then pip install ${DJANGO_14}; fi"
sh -c "if [ '${DJANGO}' = '1.5.x' ]; then pip install ${DJANGO_15}; fi"
sh -c "if [ '${DJANGO}' = '1.6.x' ]; then pip install ${DJANGO_16}; fi"
sh -c "if [ '${DJANGO}' = 'dev' ]; then pip install ${DJANGO_DEV}; fi"

@[ "${DBENGINE}" = "pg" ] && pip install -q psycopg2 || :
@pip install coverage
@python -c "from __future__ import print_function;import django;print('Django version:', django.get_version())"

Expand Down
2 changes: 1 addition & 1 deletion concurrency/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Meta:
verbose_name_plural = "NoActions-ConcurrentModels"


class TestModelWithCustomRevisionMetaInfo(ConcurrentModel):
class TestModelWithCustomOptions(ConcurrentModel):
username = models.CharField(max_length=30, blank=True, null=True)
last_name = models.CharField(max_length=30, blank=True, null=True)

Expand Down
8 changes: 4 additions & 4 deletions concurrency/tests/test_concurrencymetainfo.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from concurrency.exceptions import RecordModifiedError
from concurrency.utils import ConcurrencyTestMixin
from concurrency.tests.models import TestModelWithCustomRevisionMetaInfo, ConcurrentModel
from concurrency.tests.models import TestModelWithCustomOptions, ConcurrentModel
from django.test import TestCase


class TestCustomConcurrencyMeta(TestCase):
concurrency_model = TestModelWithCustomRevisionMetaInfo
concurrency_model = TestModelWithCustomOptions
concurrency_kwargs = {'username': 'test'}

def setUp(self):
Expand All @@ -26,8 +26,8 @@ def test_sanity_check(self):
assert not self.TARGET._concurrencymeta.sanity_check

def test_meta_inheritance(self):
# TestModelWithCustomRevisionMetaInfo extends ConcurrentModel
# but we disabled concurrency only in TestModelWithCustomRevisionMetaInfo
# TestModelWithCustomOptions extends ConcurrentModel
# but we disabled concurrency only in TestModelWithCustomOptions
import concurrency.api as api
concurrency_enabled1 = ConcurrentModel.objects.get_or_create(**{'dummy_char': 'test'})[0]
concurrency_enabled2 = ConcurrentModel.objects.get_or_create(**{'dummy_char': 'test'})[0]
Expand Down

0 comments on commit fa6084a

Please sign in to comment.