Code Duplication    Length = 14-16 lines in 2 locations

omaha_server/crash/tests/test_forms.py 2 locations

@@ 66-81 (lines=16) @@
63
            userid='{2882CF9B-D9C2-4edb-9AAF-8ED5FCF366F7}',
64
        )
65
66
        form = CrashFrom(form_data, form_file_data)
67
68
        self.assertTrue(form.is_valid())
69
        self.assertEqual(form.cleaned_data['upload_file_minidump'].name, '7b05e196-7e23-416b-bd13-99287924e214.dmp')
70
        self.assertEqual(form.cleaned_data['archive_size'], 0)
71
        self.assertEqual(form.cleaned_data['minidump_size'], 7)
72
73
    def test_form_tar_file(self):
74
        with open(TAR_FILE, 'rb') as f:
75
            form_file_data = dict(upload_file_minidump=SimpleUploadedFile(
76
                "foo.tar", f.read()))
77
        form_data = dict(
78
            appid='{D0AB2EBC-931B-4013-9FEB-C9C4C2225C8C}',
79
            userid='{2882CF9B-D9C2-4edb-9AAF-8ED5FCF366F7}',
80
        )
81
82
        form = CrashFrom(form_data, form_file_data)
83
84
        self.assertTrue(form.is_valid())
@@ 51-64 (lines=14) @@
48
49
        form = SymbolsAdminForm(form_data, form_file_data)
50
51
        self.assertTrue(form.is_valid())
52
        self.assertEqual(form.cleaned_data['debug_id'], 'C1C0FA629EAA4B4D9DD2ADE270A231CC1')
53
        self.assertEqual(form.cleaned_data['debug_file'], 'BreakpadTestApp.pdb')
54
        self.assertEqual(form.cleaned_data['file_size'], 68149)
55
56
57
class CrashFormTest(TestCase):
58
    def test_form(self):
59
        form_file_data = dict(upload_file_minidump=SimpleUploadedFile(
60
            "7b05e196-7e23-416b-bd13-99287924e214.dmp", b"content"))
61
        form_data = dict(
62
            appid='{D0AB2EBC-931B-4013-9FEB-C9C4C2225C8C}',
63
            userid='{2882CF9B-D9C2-4edb-9AAF-8ED5FCF366F7}',
64
        )
65
66
        form = CrashFrom(form_data, form_file_data)
67