Beispiel #1
0
    def test_relational(self):
        """Relational test

        Default Django ORM uses an integer-based auto field.
        """
        with self.settings(DATABASES={'default': {
                'ENGINE': 'django.db.backends.postgresql_psycopg2'}}):
            assert convert_auto_field(self.field) == models.IntegerField
    def test_relational(self):
        """Relational test

        Default Django ORM uses an integer-based auto field.
        """
        with self.settings(DATABASES={'default': {
                'ENGINE': 'django.db.backends.postgresql_psycopg2'}}):
            assert convert_auto_field(self.field) == models.IntegerField
Beispiel #3
0
    def test_non_relational(self):
        """Non-relational test

        MongoDB uses a string-based auto field. We need to make sure
        the converted field type is string.
        """
        with self.settings(DATABASES={'default': {
                'ENGINE': 'django_mongodb_engine'}}):
            assert convert_auto_field(self.field) == models.TextField
    def test_non_relational(self):
        """Non-relational test

        MongoDB uses a string-based auto field. We need to make sure
        the converted field type is string.
        """
        with self.settings(DATABASES={'default': {
                'ENGINE': 'django_mongodb_engine'}}):
            assert convert_auto_field(self.field) == models.TextField
    def test_relational(self):
        """Relational test

        Default Django ORM uses an integer-based auto field.
        """
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=UserWarning,
                                    message='Overriding setting DATABASES ' +
                                            'can lead to unexpected behavior.')
            with self.settings(DATABASES={'default': {
                    'ENGINE': 'django.db.backends.postgresql_psycopg2'}}):
                assert convert_auto_field(self.field) == models.IntegerField
Beispiel #6
0
    def test_relational(self):
        """Relational test

        Default Django ORM uses an integer-based auto field.
        """
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=UserWarning,
                                    message='Overriding setting DATABASES ' +
                                            'can lead to unexpected behavior.')
            with self.settings(DATABASES={'default': {
                    'ENGINE': 'django.db.backends.postgresql_psycopg2'}}):
                assert convert_auto_field(self.field) == models.IntegerField
    def test_non_relational(self):
        """Non-relational test

        MongoDB uses a string-based auto field. We need to make sure
        the converted field type is string.
        """

        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=UserWarning,
                                    message='Overriding setting DATABASES ' +
                                            'can lead to unexpected behavior.')
            with self.settings(DATABASES={'default': {
                    'ENGINE': 'django_mongodb_engine'}}):
                assert convert_auto_field(self.field) == models.TextField
Beispiel #8
0
    def test_non_relational(self):
        """Non-relational test

        MongoDB uses a string-based auto field. We need to make sure
        the converted field type is string.
        """

        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=UserWarning,
                                    message='Overriding setting DATABASES ' +
                                            'can lead to unexpected behavior.')
            with self.settings(DATABASES={'default': {
                    'ENGINE': 'django_mongodb_engine'}}):
                assert convert_auto_field(self.field) == models.TextField