Passed
Pull Request — master (#244)
by Piotr
01:19
created

JWTStrategyTestCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_obtain_provides_valid_token_for_given_user() 0 8 1
1
from django.test import TestCase
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
introduced by
Unable to import 'django.test'
Loading history...
2
3
from rest_framework_jwt.serializers import VerifyJSONWebTokenSerializer
0 ignored issues
show
introduced by
Unable to import 'rest_framework_jwt.serializers'
Loading history...
4
5
from djoser.social.token.jwt import TokenStrategy
6
from ..common import create_user
7
8
9
class JWTStrategyTestCase(TestCase):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
10
    def test_obtain_provides_valid_token_for_given_user(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_obtain_provides_valid_token_for_given_user does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
11
        user = create_user()
12
        res = TokenStrategy.obtain(user)
13
        self.assertEqual(res['user'], user)
14
15
        data = {'token': res['token']}
16
        serializer = VerifyJSONWebTokenSerializer(data=data)
17
        self.assertTrue(serializer.is_valid())
18