Commit 4a33912e authored by Okhin's avatar Okhin
Browse files

Let's actually run the tests

parent 6ad22830
from django.contrib.auth.models import User, Permission
from django.template.defaultfilters import slugify
from django.test import Client, TestCase
from userprofile.apps import UserprofileConfig
from userprofile.models import Profile
from userprofile.factories import ProfileFactory
class ProfileTestCase(TestCase):
def setUp(self):
self.client = Client()
p = Permission.objects.get(codename='can_edit_users')
user = User.objects.create_user('test', '', 'test')
self.user = user
def test_init(self):
assert == "userprofile"
def test_profile(self):
profile = ProfileFactory()
assert type(profile.user) == User
assert type(profile) == Profile
assert profile.slug == slugify(profile.user.username)
assert str(profile) == profile.user.username
def test_list(self):
r = self.client.get('/users/list/')
assert r.status_code == 200
assert in str(r.content)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment