GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( cc823b...3d112a )
by PyJobs
9s
created

pyjobsweb.tests.models.TestUser   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %
Metric Value
wmc 4
dl 0
loc 25
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A TestUser.test_obj_creation_email() 0 3 1
A TestUser.test_obj_creation_username() 0 3 1
A TestUser.test_no_permissions_by_default() 0 3 1
A TestUser.test_getting_by_email() 0 4 1
1
# -*- coding: utf-8 -*-
2
"""Test suite for the TG app's models"""
3
from __future__ import unicode_literals
4
from nose.tools import eq_
5
6
from pyjobsweb import model
7
from pyjobsweb.tests.models import ModelTest
8
9
10
class TestGroup(ModelTest):
11
    """Unit test case for the ``Group`` model."""
12
13
    klass = model.Group
14
    attrs = dict(
15
        group_name="test_group",
16
        display_name="Test Group"
17
    )
18
19
20
class TestUser(ModelTest):
21
    """Unit test case for the ``User`` model."""
22
23
    klass = model.User
24
    attrs = dict(
25
        user_name="ignucius",
26
        email_address="[email protected]"
27
    )
28
29
    def test_obj_creation_username(self):
30
        """The obj constructor must set the user name right"""
31
        eq_(self.obj.user_name, "ignucius")
32
33
    def test_obj_creation_email(self):
34
        """The obj constructor must set the email right"""
35
        eq_(self.obj.email_address, "[email protected]")
36
37
    def test_no_permissions_by_default(self):
38
        """User objects should have no permission by default."""
39
        eq_(len(self.obj.permissions), 0)
40
41
    def test_getting_by_email(self):
42
        """Users should be fetcheable by their email addresses"""
43
        him = model.User.by_email_address("[email protected]")
44
        eq_(him, self.obj)
45
46
47
class TestPermission(ModelTest):
48
    """Unit test case for the ``Permission`` model."""
49
50
    klass = model.Permission
51
    attrs = dict(
52
        permission_name="test_permission",
53
        description="This is a test Description"
54
    )
55