Skip to content

Commit

Permalink
Merge 95783f3 into faa6411
Browse files Browse the repository at this point in the history
  • Loading branch information
simozhan committed Oct 30, 2015
2 parents faa6411 + 95783f3 commit 0eb8e71
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
18 changes: 18 additions & 0 deletions pdc/apps/package/migrations/0006_auto_20151030_0845.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('package', '0005_auto_20150907_0905'),
]

operations = [
migrations.AlterUniqueTogether(
name='dependency',
unique_together=set([]),
),
]
5 changes: 0 additions & 5 deletions pdc/apps/package/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ class Dependency(models.Model):
comparison = models.CharField(max_length=50, blank=True, null=True)
rpm = models.ForeignKey(RPM)

class Meta:
unique_together = (
('type', 'name', 'version', 'comparison', 'rpm')
)

def __unicode__(self):
base_str = self.name
if self.version:
Expand Down
15 changes: 15 additions & 0 deletions pdc/apps/package/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,21 @@ def test_create_rpm_with_deps(self):
self.assertEqual(with_version.version, '0.1.0')
self.assertNumChanges([1])

def test_create_rpm_with_duplicate_deps(self):
data = {'name': 'fake_bash', 'version': '1.2.3', 'epoch': 0,
'release': '4.b1', 'arch': 'x86_64', 'srpm_name': 'bash',
'filename': 'bash-1.2.3-4.b1.x86_64.rpm',
'linked_releases': [], 'srpm_nevra': 'fake_bash-0:1.2.3-4.b1.src',
'dependencies': {'requires': ['required-package', 'required-package'],
'obsoletes': ['obsolete-package'],
'suggests': ['suggested-package >= 1.0.0', 'suggested-package >= 1.0.0'],
'recommends': ['recommended = 0.1.0'],
'provides': ['/bin/bash', '/usr/bin/whatever'],
'conflicts': ['nothing']}}
response = self.client.post(reverse('rpms-list'), data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertNumChanges([1])

def test_put_to_rpm_with_none(self):
data = {
'name': 'bash',
Expand Down

0 comments on commit 0eb8e71

Please sign in to comment.