Skip to content

Commit

Permalink
Add tests for saving category instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael van Tellingen committed Jan 24, 2015
1 parent 361bcb2 commit 270319e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/integration/catalogue/category_tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.core.exceptions import ValidationError
from django import template
from django.core.exceptions import ValidationError
from django.test import TestCase

from oscar.apps.catalogue import models
from oscar.apps.catalogue.categories import create_from_breadcrumbs
Expand All @@ -27,6 +27,17 @@ def test_enforces_slug_uniqueness(self):
with self.assertRaises(ValidationError):
self.products.add_child(name=u"Bücher")

def test_save_update_slug(self):
with self.assertNumQueries(2):
self.books.name = 'Books'
self.books.save()

def test_save_update_fields(self):
with self.assertNumQueries(1):
self.books.description = 'Something new'
self.books.save(update_fields=['description'])



class TestMovingACategory(TestCase):

Expand Down

0 comments on commit 270319e

Please sign in to comment.