[-] 1.6/1.7/1.8 compatiable changes (WIP)

This commit is contained in:
Jose Soares 2015-04-22 10:34:30 -04:00 committed by Corey Oordt
parent 74cc9f8346
commit a6443ada85
6 changed files with 29 additions and 11 deletions

View file

@ -3,8 +3,9 @@ python:
- "2.6"
- "2.7"
env:
- DJANGO_VERSION=1.3.1
- DJANGO_VERSION=1.4
- DJANGO_VERSION=1.6.11
- DJANGO_VERSION=1.7.7
- DJANGO_VERSION=1.8
install:
- pip install Django==$DJANGO_VERSION
- pip install -e .

View file

@ -0,0 +1,16 @@
[
{
"fields": {
"level": 0,
"lft": 1,
"name": "Category 1",
"order": 1,
"parent": null,
"rght": 10,
"slug": "category-1",
"tree_id": 1
},
"model": "categories.category",
"pk": 1
}
]

View file

@ -1,7 +1,7 @@
from django import template
from django.db.models import get_model
from django.template import (Node, TemplateSyntaxError, VariableDoesNotExist,
FilterExpression)
from django.template import (Node, TemplateSyntaxError, VariableDoesNotExist)
from django.template.base import FilterExpression
from categories.base import CategoryBase
from categories.models import Category
from mptt.utils import drilldown_tree_for_node
@ -186,7 +186,7 @@ def display_drilldown_as_ul(category, using='categories.Category'):
cat = get_category(category, using)
if cat is None:
return {'category': cat, 'path': []}
else:
else:
return {'category': cat, 'path': drilldown_tree_for_node(cat)}

View file

@ -1,2 +0,0 @@
__fixtures__ = ['categories.json']

View file

@ -1,14 +1,15 @@
# test spaces in hierarchy
# test tabs in hierarchy
# test mixed
import unittest
import os
from django.test import TestCase
from categories.models import Category
from categories.management.commands.import_categories import Command
from django.core.management.base import CommandError
class CategoryImportTest(unittest.TestCase):
class CategoryImportTest(TestCase):
def setUp(self):
pass

View file

@ -1,9 +1,11 @@
# test active returns only active items
import unittest
from django.test import TestCase
from categories.models import Category
class CategoryManagerTest(unittest.TestCase):
class CategoryManagerTest(TestCase):
fixtures = ['categories.json']
def setUp(self):
pass