https://docs.djangoproject.com/en/2.1/_modules/django/test/testcases/#TestCase.setUpTestData
As far as I know, the convention is to use snake case for method names, so why do we see some methods in camel case in Python?
Camel case (ex: camelCase) is usually for variables, properties, attributes, methods, and functions. Snake case (ex: snake_case) is commonly used in scripting languages like Python and as a constant in other C-styled languages. Pascal case (ex: PascalCase) is mainly reserved for class names, interfaces, and namespaces.
When multiple words are used to form a variable, camel case joins those words together, without any white space, and delineates the start of each new word with a capital letter. In contrast, snake case uses an underscore between words to create separation.
When a computer parses text, it treats the spaces as a delimiter between words. CamelCase is most used in places where white space is not allowed for technical reasons. This can make the phrase hard to read or ambiguous.
Python, by contrast, recommends snake case, whereby words are instead separated by underscores ( _ ), with all letters in lowercase.
Django's test framework inherits from Python's unittest module. That in turn is heavily based on the Java jUnit framework. Java uses camel case naming conventions; when the code was ported to Python the names were kept.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With