Passed
Push — master ( 3d0ccf...cb96a6 )
by Piotr
01:35
created

CompatTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_get_user_email_field_name_returns_proper_value() 0 8 2
1
from django.contrib.auth import get_user_model
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.contrib.auth'
Loading history...
2
from django.test.testcases import SimpleTestCase
0 ignored issues
show
introduced by
Unable to import 'django.test.testcases'
Loading history...
3
import django
0 ignored issues
show
introduced by
Unable to import 'django'
Loading history...
4
5
from djoser.compat import get_user_email_field_name
6
from djoser.conf import settings
7
8
User = get_user_model()
0 ignored issues
show
Coding Style Naming introduced by
The name User does not conform to the constant naming conventions ((([A-Z_][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...
9
10
11
class CompatTestCase(SimpleTestCase):
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...
12
    def test_get_user_email_field_name_returns_proper_value(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_get_user_email_fiel...me_returns_proper_value 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...
13
        if django.VERSION >= (1, 11):
14
            email_field_name = User.get_email_field_name()
15
        else:
16
            email_field_name = settings.USER_EMAIL_FIELD_NAME
17
18
        user_email_field_name = get_user_email_field_name(User)
19
        self.assertEquals(user_email_field_name, email_field_name)
20