Skip to content

Commit

Permalink
Added basic TestCase for user parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
p3dda committed Mar 10, 2015
1 parent fda0475 commit 00cc247
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions activities/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,31 @@
import django.test.client
from django.test import TestCase

from django.contrib.auth.models import User
from django.conf import settings as django_settings
from django.core.urlresolvers import reverse


class UserTest(TestCase):
fixtures = ['activities_testdata.json', 'activities_tests_authdata.json']

def setUp(self):
self.client = django.test.client.Client()

def test_user_parameters(self):
user = User.objects.get(username='test1')
params = user.params
self.assertEqual({}, params.asPyDict())

params['foo'] = 'bar'
self.assertEqual({'foo': 'bar'}, params.asPyDict())
self.assertEqual(user.params['foo'], 'bar')
self.assertListEqual(user.params.keys(), ['foo'])

del params['foo']
self.assertListEqual(user.params.keys(), [])


class ActivityTest(TestCase):
fixtures = ['activities_testdata.json', 'activities_tests_authdata.json']

Expand Down

0 comments on commit 00cc247

Please sign in to comment.