pythondjangonaming-conventionspascalcasingsnakecasing

Why are some Django methods PascalCase and others snake_case?


As far as I know, the convention is to use snake_case for method names, so why are some methods in Django PascalCase, e.g. Django's TestCase Class?


Solution

  • Django's Testing framework inherits from Python's unittest module. That, in turn, is heavily based on the Java JUnit framework. Java uses PascalCase naming conventions; when the code was ported to Python the names were kept.