# Path: staff/models.py
# class StaffMember(BaseStaffMember):
#     pass


from django.test import TestCase
from django.contrib.auth.models import User
from staff.models import StaffMember
from django.template.defaultfilters import slugify
# Changing the staff member's first name, last name or email should change the user's as well
# Changing the staff member's first name or last name should change the slug
#   It would really be cool if you changed the slug, you check if redirects is
#   enabled and insert a redirect from the old slug to the new slug
# Changing the user's first name, last name or email should change the staff member's as well
# Changing the user's first name or last name should change the staff member's slug



class StaffTest(TestCase):
    """Tests for the Staff model"""
    def setUp(self):
        self.user = User.objects.create_user("tempuser", "tempuser", "temp@user.com")
        self.user.first_name = "Temporary"
        self.user.last_name = "User"
        self.user.save()

    def assertStaffInfoEqual(self, staffmember, user):
        self.assertEqual(staffmember.first_name, user.first_name)
        self.assertEqual(staffmember.last_name, user.last_name)
        self.assertEqual(staffmember.email, user.email)
        self.assertEqual(staffmember.slug, slugify('%s %s' % (user.first_name, user.last_name)))

    def testAutoCreation(self):

# Path: staff/models.py
# class StaffMember(BaseStaffMember):
#     pass


# Path: staff/tests.py
from django.test import TestCase
from django.contrib.auth.models import User
from staff.models import StaffMember
from django.template.defaultfilters import slugify

# Changing the staff member's first name, last name or email should change the user's as well
# Changing the staff member's first name or last name should change the slug
#   It would really be cool if you changed the slug, you check if redirects is
#   enabled and insert a redirect from the old slug to the new slug
# Changing the user's first name, last name or email should change the staff member's as well
# Changing the user's first name or last name should change the staff member's slug



class StaffTest(TestCase):
    """Tests for the Staff model"""
    def setUp(self):
        self.user = User.objects.create_user("tempuser", "tempuser", "temp@user.com")
        self.user.first_name = "Temporary"
        self.user.last_name = "User"
        self.user.save()

    def assertStaffInfoEqual(self, staffmember, user):
        self.assertEqual(staffmember.first_name, user.first_name)
        self.assertEqual(staffmember.last_name, user.last_name)
        self.assertEqual(staffmember.email, user.email)
        self.assertEqual(staffmember.slug, slugify('%s %s' % (user.first_name, user.last_name)))

    def testAutoCreation(self):

        self.assertEqual(StaffMember.objects.all().count(), 0)